How do you squash commits during a rebase?
a) Use
git rebase -i and mark the commits you want to squash as “squash”b) Use
git squash after rebasingc) Use
git merge --squashd) Use
git squash rebaseAnswer:
a) Use
git rebase -i and mark the commits you want to squash as “squash”Explanation:
To squash commits during a rebase, you use the git rebase -i (interactive rebase) command and mark the commits you want to combine with “squash.” This combines multiple commits into one, keeping the commit history cleaner.
During the interactive rebase process, you’ll be prompted to squash or reword commits as necessary.
Squashing commits is helpful for simplifying commit history before merging branches.