I have a branch \'firstproject\' with 2 commits. I want to get rid of these commits and make them appear as a single commit.
The command git merge --squash
git rebase -i HEAD~ (i.e. git rebase -i HEAD~5)txt file change pick keyword to squash for all commits, except first commit (which is on the top). For top one change it to reword (which means you will provide a new comment for this commit in the next step) and click SAVE! If in vim, press esc then save by entering wq! and press enter.Done