Question: If you have several commits for a single feature, what is the most efficient way to restructure your commit history?
- Use git stash to consolidate the commits under a new hash.
- Use git squash to consolidate the commits together into a single coherent commit.
- Delete the task commits and recommit with a new message.
- Use git cherry-pick to place the commits in another branch.
Answer: The correct answer of the above question is Option B:Use git squash to consolidate the commits together into a single coherent commit.