2011-09-27 16:26:37 +0000 2011-09-27 16:26:37 +0000
53
53
Advertisement

如何在不丢失任何文件的情况下合并两个分支?

Advertisement

我有两个分支,里面有以下文件。

branch a:

file_a
file_b
file_c

branch b:

file_a
file_d
file_e

我想把它们合并,这样我就能从ab中得到两个文件(通常这两个文件中存在的文件应该被合并)!这可行吗?

Advertisement
Advertisement

答案 (1)

97
97
97
2011-09-27 18:36:11 +0000

这可能会有帮助。 http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

在你的情况下,你应该做如下操作:

  • git checkout a (你将切换到分支a)
  • git merge b (这将把分支b的所有更改合并到分支a)
  • git commit -a (这将提交你的更改)

看一下上面的链接,就能了解全部情况。

Advertisement

相关问题

19
4
12
5
2
Advertisement
Advertisement