[英]git branch commit does not merge into master
在git窗口中,我执行了以下命令:
git branch
master
*wcopy
git commit -am "modified provider features"
On branch wcopy
Your branch is up to date with 'origin/wcopy'.
nothing to commit, working tree clean
git merge wcopy
Already upto date
git push origin master
Everything up-to-date
我去git hub仓库分支主管说:最近提交9天前
分支wcopy说:该分支在前面提交2次,在master后面5次。 最新提交db8bdca 18分钟前
我检查了brnach wcopy代码是最新的,但高手在后面。
我通过git命令合并到master中,但是它仍然显示两个单独的分支,其中wcopy后面有master
(1)如何使大师保持最新状态? (2)另外,我在源代码上将文件DB / Model.xcdatamodeld重命名为Model.xcdatamodeld。 但是wcopy分支将路径显示为DB / Model.xcdatamodeld / GridModel.xcdatamodel,表示该路径跳过了空目录。 如果我查看源代码上的实际代码,它将正确显示为DB / Model.xcdatamodeld的路径,我不知道为什么会有所不同?
我通过git命令合并到master中,但是它仍然显示两个单独的分支,其中wcopy后面有master
当您这样做时:
git merge wcopy
您将wcopy
合并到自身,即wcopy
分支中,该分支当然不执行任何操作。 您应该先切换到master
分支,然后再进行合并:
git checkout master
git merge wcopy
# resolve possible merge conflicts...
git push origin master
而不是这样做:
git merge wcopy
通过这样做,您将wcopy
合并到自身中(这不是您所需要的)。 您应该已经切换到master
分支,然后通过执行以下操作将合并的wcopy
分支合并为master
:
git pull origin wcopy
# to make sure you are up to date on wcopy branch
git checkout master
# to have your master branch up to date with the remote.
git pull origin master
git merge wcopy
# resolve possible merge conflicts if any.
git push origin master
这样可以解决所有问题,并将分支wcopy
与master
合并。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.