首页 > 其他 > 详细

git format-patch 常用方法

时间:2015-12-17 15:44:42      阅读:346      评论:0      收藏:0      [点我收藏+]

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 命令。

git format-patch 常用方法

原文:http://www.cnblogs.com/viewcozy/p/5054003.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!