您的位置:首页 > 其它

Git 常用操作(十) git merge1

2017-10-13 12:11 204 查看
Section1 简单用法

假设A分支分出一个B分支,

A分支不做修改,B分支做一点修改

这时把B合到A上,

superDy@DESKTOP-85E2I07 MINGW64 /c/test/gittest/GitTest (master)

$ git branch

* master

  newTestBranch

  test3

superDy@DESKTOP-85E2I07 MINGW64 /c/test/gittest/GitTest (master)

$ git merge newTestBranch

Updating 1d9c251..18edd6f

Fast-forward

 test10.txt | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)

superDy@DESKTOP-85E2I07 MINGW64 /c/test/gittest/GitTest (master)

Section2   处理交换文件问题

假设上面的情况A分支和B分支都做修改,则

发现交换文件 "C:/test/gittest/GitTest/.git/.MERGE_MSG.swp"

            所有者: superDy    日期: Fri Oct 13 12:06:39 2017

            文件名: /c/test/gittest/GitTest/.git/MERGE_MSG

            修改过: 是

            用户名: superDy      主机名: DESKTOP-85E2I07

           进程 ID: 377424

正在打开文件 "C:/test/gittest/GitTest/.git/MERGE_MSG"

              日期: Fri Oct 13 14:06:56 2017

      比交换文件新!

(1) Another program may be editing the same file.  If this is the case,

    be careful not to end up with two different instances of the same

    file when making changes.  Quit, or continue with caution.

(2) An edit session for this file crashed.

    如果是这样,请用 ":recover" 或 "vim -r C:/test/gittest/GitTest/.git/MERGE_MSG"

    恢复修改的内容 (请见 ":help recovery")。

    如果你已经进行了恢复,请删除交换文件 "C:/test/gittest/GitTest/.git/.MERGE_MSG.swp"

    以避免再看到此消息。

解决方案  输入 D 回车,表示  删除交换文件 "C:/test/gittest/GitTest/.git/.MERGE_MSG.swp"

即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git