git: Your branch and 'origin/master' have diverged - how to throw away local commits?

前端 未结 6 1392
臣服心动
臣服心动 2020-12-22 17:07

I have the following message in git:

# Your branch and \'origin/master\' have diverged,
# and have 3 and 8 different commits each, respectively.
#   (use \"         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 17:46

    As an alternative to merging, you can rebase the feature branch onto master branch using the following commands:

    git checkout feature
    git rebase master
    

提交回复
热议问题