Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何合并分支的Git推送副本_Git - Fatal编程技术网

如何合并分支的Git推送副本

如何合并分支的Git推送副本,git,Git,我这样做: cd /repo1 git clone <remote-repo> git checkout -b mynewbranch <edit1> git add git commit <edit2> git add git commit cd /repo2 git clone <remote-repo> cd /repo1 git checkout master git merge mynewbranch # messages # All

我这样做:

cd /repo1
git clone <remote-repo>
git checkout -b mynewbranch
<edit1>
git add
git commit
<edit2>
git add
git commit

cd /repo2
git clone <remote-repo>

cd /repo1
git checkout master
git merge mynewbranch
# messages
# All merged Ok.

git checkout mynewbranch
git push /repo2 mynewbranch:mynewbranch

cd /repo2
git branch
* master
  mynewbranch
git merge mynewbranch
# Tons of merge conflict errors
cd/repo1
git克隆
git签出-b mynewbranch
git添加
git提交
git添加
git提交
cd/repo2
git克隆
cd/repo1
切换到主分支
git合并mynewbranch
#信息
#好的。
吉特结帐mynewbranch
git推送/回购2 mynewbranch:mynewbranch
cd/repo2
吉特分行
*主人
我的新农场
git合并mynewbranch
#大量合并冲突错误
目录repo1和repo2具有完全相同版本和代码分支的克隆
git branch-r
在两个目录中也表示相同的内容

在repo1中合并我的分支非常有效。但当我将该分支推到repo2并尝试相同的合并时,会出现合并冲突


我错过了什么?这是否可以正确执行?

在这两种情况下,
git branch-r
表示相同的内容,即远程回购参考的名称。