git merge --squash for merging without commit history
Say you created a new branch to work on issue #10:
git checkout -b iss10
Now you've made some commits and ready to apply them to master, but you want them to be all in one commit.
git checkout master
git merge --squash iss10
git commit -m "Merged iss10"
In case you need to merge iss10 into master again in the future, right now you should update iss10 to base off master:
git branch -D iss10
git checkout -b iss10
git push -f origin iss10
That's it.
Written by Marika Wei
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#