简体   繁体   English

git rebase工作流问题

[英]Git rebase workflow issues

There are many posts / questions / blogs about git rebase workflow. 关于git rebase工作流程有很多帖子/问题/博客。 The following is what I understood and performed: 以下是我理解并执行的操作:

Rebase the local master to upstream 将本地主机重新部署到上游

git fetch upstream
git rebase upstream/master
git reset --hard upstream/master

Rebase the fork master to upstream 将派生母版重新部署到上游

git push origin +master

So far so good .. Now: attempt to Rebase the local branch to local master 到目前为止一切顺利..现在:尝试将本地分支重新建立为本地主服务器

git checkout strlen
git rebase -i HEAD~50  
# In the interactive I do a bunch of fixups and move the latest branch commit to the top

Some merge conflicts: so let us try to resolve them git status 一些合并冲突:所以让我们尝试解决它们git status

# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#   both modified:      sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala
#   both modified:      sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
#   both modified:      sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

So let's do the manual merge and then add them: 因此,让我们进行手动合并,然后添加它们:

meld sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala
meld sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
meld  sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
git add -a
git rebase -i --continue

Now here is the spot I get confused: the rebase now still complains about the same three files requiring a merge. 现在这是让我感到困惑的地方:现在,重新基准仍然抱怨需要合并的三个文件。 But now it shows the merge conflict is due to an earlier commit on the same branch (strlen) . 但是现在它表明合并冲突是由于对同一分支(strlen)较早提交所致。 But why? 但为什么? The rebase should have only had ONE merge conflict - tops - per file. 每个文件的rebase应该只有一次合并冲突-tops。 Why are multiple merge conflicts happening on the same files? 为什么在同一文件上发生多个合并冲突?

I have modified the workflow a bit to the following: 我对工作流程进行了一些修改,如下所示:

git pull --rebase origin mybranch git pull --rebase起源mybranch

git rebase --continue git rebase-继续

git push -f origin mybranch git push -f起源mybranch

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

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