I'm looking for a git command to help me with my feature branches when they're ready to go into Master. This git command would squash all my changes on my branch into a single commit on top of master. I do this today with:
git rebase origin/master
git rebase -i HEAD~4
Where 4 is the number of commits to squash. However, this requires me to know how many commits I have. I do this today by running:
git log HEAD...origin/master
and then counting the commits.
I feel as though there should be a better way to do this. Or is this how everyone else does it, too?
git rebase -i origin/master && git checkout master && git merge <feature_branch>
does? – Cammgit log --oneline master..FEATURE-BRANCH | wc -l
– Apocalypse