简体   繁体   中英

Git rebase workflow issues

There are many posts / questions / blogs about git rebase workflow. 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

# 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) . But why? The rebase should have only had ONE merge conflict - tops - per file. 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 rebase --continue

git push -f origin mybranch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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