git 只merge一个commit的方法
https://git-scm.com/book/tr/v2/Git-Basics-Viewing-the-Commit-History
gil log 来查看commit的记录
Other maintainers prefer to rebase or cherry-pick contributed work on top of their master branch, rather than merging it in, to keep a mostly linear history. When you have work in a topic branch and have determined that you want to integrate it, you move to that branch and run the rebase command to rebuild the changes on top of your current master (or develop, and so on) branch. If that works well, you can fast-forward your master branch, and you’ll end up with a linear project history.
The other way to move introduced work from one branch to another is to cherry-pick it. A cherry-pick in Git is like a rebase for a single commit. It takes the patch that was introduced in a commit and tries to reapply it on the branch you’re currently on. This is useful if you have a number of commits on a topic branch and you want to integrate only one of them, or if you only have one commit on a topic branch and you’d prefer to cherry-pick it rather than run rebase. For example, suppose you have a project that looks like this:

If you want to pull commit e43a6 into your master branch, you can run
$ git cherry-pick e43a6
Finished one cherry-pick.
[master]: created a0a41a9: "More friendly message when locking the index fails."
3 files changed, 17 insertions(+), 3 deletions(-)
This pulls the same change introduced in e43a6, but you get a new commit SHA-1 value, because the date applied is different. Now your history looks like this:

Now you can remove your topic branch and drop the commits you didn’t want to pull in.
git 只merge一个commit的方法的更多相关文章
- [VC]在VC++中实现让程序只运行一个实例的方法且实现该实例
方法一: 有时候在开发应用程序时,希望控制程序运行唯一的实例.例如,最常用的mp3播放软 件Winamp,由于它需要独占计算机中的音频设备,因此该程序只允许自身运行唯一的一个例程.在Visual C+ ...
- 关于WPF程序只运行一个实例的方法
找到的方法有两种: 1)http://www.cnblogs.com/liuyazhou/archive/2009/11/02/1594364.html 2)http://codereview.sta ...
- 虚拟机中安装完Lunix系统后,开机黑屏,只显示一个-,解决方法
1,查看设置->硬盘是不是SCSI,如果是,先关闭虚拟机,移除该硬盘(实际数据不会删除) 2,添加一个新的虚拟硬盘,最后位置选IDE设备 3,确定,重启虚拟机即可
- git只合并某一个分支的某个commit
第一种情况:只合并一个commit git checkout develop-hbb git cherry-pick 7c32be61 以上,7c32be61是develop上的一个fix bug的c ...
- ExpandableListView(三)只展开一个group,没有child不展开group
本文是自己在实践中,发现的问题. 有时候想让界面更加的人性化,就要实现很多的效果,比如只展开一个group,在点击下个group的同时,关闭之前的group 在一个ExpandableListView ...
- vc++高级班之窗口篇[4]---让程序只运行一个实例
大家都看过或者使用过类似只运行一个实例的程序,比如:QQ游戏.部分浏览器 等等! 让一个程序只运行一个实例的方法有多种,但是原理都类似,也就是在程序创建后,有窗口的程序在窗口创建前, 检查系统中是 ...
- git 如何revert指定范围内的commit并且只生成一个新的commit?
答:一共分成两步 一. revert多个commit并生成多个新的commit git revert <old commit>^..<new commit> 二. 使用reba ...
- Git如何修改一个过去的Commit
假设我的git log 如下: commit 5511533dda6fee6982175fafca1f4bd5692e3d9c (HEAD -> trans, origin/trans) Aut ...
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
在使用git pull拉取服务器最新版本时,如果出现error: Your local changes to the following files would be overwritten by m ...
随机推荐
- 关于v$BH
关于v$bh的相关字段值FILE# NUMBER Datafile identifier number (to find the filename, query DBA_DATA_FILES or V ...
- Spring AOP详解及简单应用
Spring AOP详解 一.前言 在以前的项目中,很少去关注spring aop的具体实现与理论,只是简单了解了一下什么是aop具体怎么用,看到了一篇博文写得还不错,就转载来学习一下,博文地址: ...
- curl_setopt设置发送cookie信息
1.php curl访问会话传递问题 curl_setopt($ch , CURLOPT_COOKIE , 'PHPSESSID=A7281E0926CB37D791AD464CDD646CF2') ...
- Python基础部分
Python基础一 Python基础二 字符串相关操作一 列表及元组 字典介绍及其操作 Python 中的 is 和 == 编码和解码 Python中的 set 与 深浅拷贝 Python 的文件操作
- 3.Redis 数据类型
转自:http://www.runoob.com/redis/redis-tutorial.html Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集 ...
- Python的输入输出
一:Python2.x版本下的输入输出 Python2.x 下的输入 1)raw_input 格式:result = raw_input("提示信息")功能:1)会等待用户输入内容 ...
- 为什么是static?
为什么是static因为系统开始执行一个程序前,并没有创建main()方法所在类的实例对象,它只能通过类名类调用主方法. public static void main(String args[])我 ...
- [Android]RecyclerView添加HeaderView出现宽度问题
通过getItemViewType方式判断HeaderView方式添加HeaderView的,结果发现有几个界面HeaderView宽度不能满屏. 于是对比了几种布局,发现LinearLayout为根 ...
- 网页静态化解决方案:Freemarker生成简单html页面
FreeMarker 是一个用 Java 语言编写的模板引擎,它基于模板来生成文本输出.FreeMarker与 Web 容器无关,即在 Web 运行时,它并不知道 Servlet 或 HTTP.它不仅 ...
- JS的事件汇总
一.前言 事件的绑定触发有很多种方法,我们如何选择呢? 很多时候,我们会使用鼠标事件,但是鼠标事件只能在PC设备上使用,当我们需要对不同设备兼容时怎么办呢? 二.正文 1. 事件的几个概念: 事件流: ...