Skip to main content

Posts

Showing posts with the label rebase

Why git push --force after rebase

https://stackoverflow.com/questions/8939977/git-push-rejected-after-feature-branch-rebase This post explain why we have to git push --force after rebase, otherwise it show error/warning message. I'm too lazy to find it out, but this explain seem quite straightforward. The problem is that git push assumes that remote branch can be fast-forwarded to your local branch, that is that all the difference between local and remote branches is in local having some new commits at the end like that: Z--X--R         <- origin/some-branch (can be fast-forwarded to Y commit)        \                 T--Y    <- some-branch When you perform git rebase commits D and E are applied to new base and new commits are created. That means after rebase you have something like that: A--B--C------F--G--D'--E'   <- feature-branch        \           D...