How do you squash commits in Git?
a) By using
git rebase -i (interactive rebase)b) By using
git squashc) By using
git commit --squashd) By using
git combineAnswer:
a) By using
git rebase -i (interactive rebase)Explanation:
To squash commits in Git, you use the git rebase -i (interactive rebase) command. Squashing commits combines multiple commits into a single one, simplifying the commit history.
During the rebase process, you can choose which commits to squash, which is useful for cleaning up your project history before merging it into the main branch.
This technique is often used to maintain a more concise and understandable commit history.