Squash commits into one with Git | Drupal 8

Squash commits into one with Git

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

Steps:

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

2. Rebase
git rebase -i HEAD~N --rebase-merges
git rebase -i HEAD~7 --rebase-merges
OR
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

Tags

Add new comment

Plain text

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