Squash commits into one with Git | Drupal 8

Squash commits into one with Git

Submitted by editor on Tue, 04/06/2021 - 11:02


1. Update branche
git reset --hard origin/features/BRANCHNAME
git pull origin features/BRANCHNAME

2. Rebase
git rebase -i HEAD~N --rebase-merges
git rebase -i HEAD~7 --rebase-merges
git rebase -i COMMIT-NUMBER --rebase-merges

3. Change pick by s (Squash) except first

4. Comment unwanted comment texts

5. Check rebase and push using --force


Other commands:

git rebase --continue

git rebase --abort


Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.