Move remote branch tip from one branch to another
So currently now I have
- Why does git rebase often have fewer merge conflicts than a merge?
- Git pull --rebase converting spaces to tabs
- Avoid merge commit in git
- How to rebase Git commits to SVN after having initialized the Git repository in an SVN directory?
- GitHub Undo a (not most recent) Merge
- Git rebasing not working correctly?
c1 - c2 - c3 - c5(master HEAD) \ c4(feature HEAD) - c5(origin/master HEAD)
I realize that fixing this will screw up anyone who has pulled in changes from origin/master. But there is only one other developer so this is not that much of an issue. How do I change origin/master so it’s not after the feature branch. I’d like it to be this:
c1 - c2 - c3 - c5(master HEAD)(origin/master HEAD) \ c4(feature HEAD)
One Solution collect form web for “Move remote branch tip from one branch to another”
Use a forced push from master to origin/master:
git push origin master:master --force
The other developer will need to
reset his master to the remote master afterwards (preferably a hard reset after saving his work):
git fetch origin git checkout master git reset --hard origin/master