Git/hacks: Difference between revisions

Move daily workflow to the top
Don't merge, Rebase!: better describe the daily workflow as compared to the release cycle workflow for rebasing versus merging.
Line 220: Line 220:
==Don't merge, Rebase!==
==Don't merge, Rebase!==


Get familiar with how to rebase your work each day http://www.bitsnbites.eu/a-tidy-linear-git-history/
For your daily workflow, get familiar with how to rebase your work. Check http://www.bitsnbites.eu/a-tidy-linear-git-history/


If you forget to pull before you commit some local changes, you might just be able to `git rebase` to pull and re-play your changes on top of the branch.
You might be working on your feature branch long enough that there are simply other patches or work landing on 'main' (or whatever your base branch is) that you wish to incorporate into your feature. You should be able to simply <code>git rebase</code> to fetch and re-play your changes on top of the branch you started from.
 
Rebasing is best when you have not shared your work with other team members and you want to absorb pertinent changes happening in the 'main' or 'release' branch that your work was based off of.
 
== Don't rebase, Merge! ==
For a general development workflow incorporating work from a release cycle back into main, merge the release branch into main at the end of the release cycle. If there are some changes that land in main before the release is complete, then merge main into the release branch to continue the release cycle and eventually merge release/x.y.z back into main.


==Delete local and remote merged branches==
==Delete local and remote merged branches==