例如:
如果我执行以下操作(将stase转换为master并将其合并到prod版本中):
消息:
Switched to branch 'staging'
Your branch and 'origin/staging' have diverged,
and have 20 and 19 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
如果我然后运行git pull
& git status
会说:
On branch staging
Your branch is ahead of 'origin/staging' by 21 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
我的本地分支如何提前21次提交?!我所做的只是将staging(有1个修复分支和1个提交)合并到master中?!
请注意,如果我将开发转换并合并到staging上,就会发生这种情况。它是否像每个发布步骤一样延续了?!
我的设置如下:开发 - >暂存(发布到登台服务器) - >生产(发布到生产服务器)
目前,当发生这种情况时,我所知道的是reset --hard origin/<branch>