Git分支已经分歧了

时间:2016-06-20 20:55:38

标签: git

我在我的组织的Bitbucket帐户中使用SourceTree在tracking-branch分支(见下文)上创建了dev-26。以下是我的本地和远程存储库的大致情况:

$ git branch
  master
* dev-26

$ git branch -r
  origin/HEAD
  origin/master
  origin/dev-1
  origin/dev-2
  origin/dev-26

我在本地dev-26分支机构的星期五6/17 上提交了更改。从那时起,我已经多次git pull fetch mergeorigin/dev-26dev-26更改到我的本地git status分支。但是,我从未推动过我的改变。

出于某种原因,当我On branch dev-26 Your branch and 'origin/dev-26' have diverged, and have 1053 and 295 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean 时,我收到以下消息:

git pull

随后,当我origin/dev-26时,我收到很多冲突错误消息。在这一点上,我迷失了,只是想放弃我在星期五6月17日所做的任何改变,并拉出目前git reset --hard上的任何内容

所以,我在星期四6月16日的最后一次提交中git pull,并希望当我dev-26时,它会同步我的本地origin/dev26分支On branch dev-26 Your branch and 'origin/dev-26' have diverged, and have 1053 and 295 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean 分支。但是,我一直收到相同的消息(无论我将分支重置到多远):

dev-26

我想我可能已经搞砸了。有人可以帮我调试/解释正在发生的事情和/或找到答案来放弃我在星期五6/17 上所做的更改,并将我的本地origin/dev-26.content_location{ padding: 0; padding-bottom: 50px; margin: auto; position: absolute !important; right: 0 !important; left: 0 !important; width: 95%; height: 35vh; overflow: visible; } #content_location{ width: 100%; height: 100%; overflow: visible; } 同步?

1 个答案:

答案 0 :(得分:0)

您可以使用以下命令避免这种情况。

git reset --hard origin/dev-26