4 ms·
This is very good advice! git --rebase will clobber local merge commits (e.g. when closing off a feature branch & getting ready to push the merged results). I
by Zombieball 13y ago
This is very good advice!
git --rebase will clobber local merge commits (e.g. when closing off a feature branch & getting ready to push the merged results).
I threw together a quick custom action you can use with Sourcetree to utilize git rebase -p. Interested folks can nab it here: https://gist.github.com/dgourlay/5465540 https://gist.github.com/dgourlay/5465540 Install instructions here: http://www.derekgourlay.com/archives/478 http://www.derekgourlay.com/archives/478
I think I may need to give git-up a look over though.
Thanks!
- jcrites 13y ago> local merge commits (e.g. when closing off a feature branch & getting ready to push the merged results Why not rebase the feature branch onto the master branch? Then the merge from feature to master will be a fast forward commit rather than a merge commit. Developing this way one can mostly avoid actual merges. And the repository history is simple and linear afterward. I've been working this way for a while and I have found it effective. % git checkout feature % git rebase master % git checkout master % git merge --ff-only feature (-ff-only isn't needed, but I like to confirm to catch mistakes) Any commits that you have made locally (and haven't pushed anywhere public) are safe to reorganize in this way, and it results in simpler history.
- ricardobeat 13y agoIf your workflow is based on very small feature branches, that's fine, but when your branch is more heavy on changes it's good to preserve the merge commit (and be able to undo it).
- Zombieball 13y agoYes this is precisely what I had in mind, for larger features I personally prefer to see merge commits and not rebase the branch onto master. I believe it is one place where merge commits definitely add value and make sense.