version control - Git: How to squash all commits on branch -
i make new branch master
with:
git checkout -b testbranch
i make 20 commits it.
now want squash 20 commits. with:
git rebase -i head~20
what if don't know how many commits? there way like:
git rebase -i on branch
another way squash commits reset index master:
git checkout yourbranch git reset $(git merge-base master yourbranch) git add -a git commit -m "one commit on yourbranch"
this isn't perfect implies know branch "yourbranch" coming from.
note: finding origin branch isn't easy/possible git (the visual way easiest, seen here).
Comments
Post a Comment