合并后的本地提交

问题描述 投票:1回答:1

我正在开发一个功能分支(让我们称之为DEV-1234),尚未做出任何更改,几天休息后重新开始工作,当然开发分支有很大的变化,我想要合并到我的功能分支,以便开始使用最新版本的代码。

所以,我这样做了:

git checkout develop
git pull 
git checkout feature/DEV-1234
git merge develop

现在,当我检查该分支上的git状态时,我得到了这个:

$ git status
On branch feature/DEV-1234
Your branch is ahead of 'origin/feature/DEV-1234' by 503 commits.
(use "git push" to publish your local commits)

我没有任何本地提交。或者合并计为本地提交?如果我按照它的建议在这个分支中制作git push会发生什么?

git git-merge git-push git-pull feature-branch
1个回答
1
投票

如果您现在推送您的分支,您将更新分支的远程版本,该分支在与最新提交合并之前当前具有ref。

但是,没有必要,你现在也可以在它上面工作,只有当你认为它准备好拉动请求时才推动它。

初始状态:

A---B <<< develop, feature-branch, origin/feature-branch
     \
      C--(snip 510 commis)--D <<< origin/develop

拉开后:

A---B <<< feature-branch, origin/feature-branch
     \
      C--(snip 510 commis)--D <<< develop, origin/develop

合并之后into feature-branch

      origin/feature-branch
     /
A---B-------------------------E <<< feature-branch
     \                       /
      C--(snip 510 commis)--D <<< develop, origin/develop

最后当你推动时:

A---B-------------------------E <<< feature-branch, origin/feature-branch
     \                       /
      C--(snip 510 commis)--D <<< develop, origin/develop
© www.soinside.com 2019 - 2024. All rights reserved.