http://blog.csdn.net/txgc1009/article/details/6782008
版权声明:本文为博主原创文章,未经博主允许不得转载。
1.仓库中,master上开出一个新的branch,暂定为alex。
2.git checkout alex
vim file
git add file
git commit -m "1st modify --- alex branch"
3.git show-branch --more=4 alex
[alex] 1st branch modify alex[alex^] creat test file.
4. 创建patch。
git format-patch -1
或者 :
git format-patch alex^..alex
5. git checkout master
git apply *.patch
git apply *new.patch
至此,patch成功地打入到master上。
Note:
1.请注意,git apply
是一个事务性操作的命令,也就是说,要么所有补丁都打上去,要么全部放弃。
2.对于传统的 diff
命令生成的补丁,则只能用 git apply
处理。
对于 format-patch
制作的新式补丁,应当使用 git am
命令。