Difference between `git rebase -i master` vs `git rebase -i origin/master`

后端 未结 4 945
花落未央
花落未央 2021-01-24 20:20

Combining multiple commits before pushing in Git

Based on my understanding, if I use git rebase -i master, then later I still need to git push origin

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 20:50

    Note that if you are on branch X and you do git rebase -i master, it changes branch X, not master, so you would have to push branch X.

    Anyway, if origin/master points to the same commit as master (i.e. your master branch is up to date), then it doesn't matter if you rebase onto one or the other. If they point to different commits, then you will be rebasing onto whatever commit the branch you choose points to.

提交回复
热议问题