繁体   English   中英

Git 获取/合并混淆

[英]Git Fetch/Merge Confusion

我正在通过 Git 中的各种教程来理解它。

我有一个远程“Origin”,它有两个分支“master”和“development”。

我在 GitHub 上对开发进行了某些更改并提交了它。 然后我去了我当地的主分支使用

git checkout master

并使用

git fetch origin development:development

现在,如果我使用创建合并请求

git merge origin/development 

或者

git git merge origin/development development

然后两个分支也在我的本地更新。

我不知道发生了什么。

当您在检出master同时执行git merge origin/development时,您将origin/development分支合并到您的master分支中。 这就是为什么您在 github 的development分支上所做的更改会出现在您的本地master

如果您想将 github 的development更改显示在您的本地development请执行以下操作

git fetch origin development
git checkout development
git merge origin/development

或者

git fetch origin development:development
git checkout development

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM