Rebase Branch on Git Tag12 Sep 2018
You fork a GitHub project and start working on a feature around v0.15. The upstream repository pushes updates and now master is ahead v0.17. But you need to rebase your feature on top of v0.16 as per client requirements. How would you handle this?
My Git remotes are respectively
origin been my fork and
upstream been the original repository. The following requirement was an actual requirement I met today to prepare a feature for a client based on a specific version of the app.
- Sync the repositories if applicable
#~ git fetch upstream #~ git merge upstream/master
- Checkout your branch
#~ git checkout feature/2-ideas
- Rebase the branch
#~ git rebase --onto v0.16 master
Yes, thats it! How ever I had to deal with a shit load of conflicts… hope you have better luck.