How to squash or fixup commits?
Answer / Rajat Madan
To squash multiple commits into one, you can use the command `git rebase -i <base_branch>`. In the interactive mode, change 'pick' at the beginning of each commit you want to squash to 'squash', then save and exit. To fixup (amend the last commit), use `git rebase -i HEAD~<number_of_commits>` and change 'pick' to 'fixup!'.
| Is This Answer Correct ? | 0 Yes | 0 No |
Name a few git commands?
What is git bisect? How can you use it to determine the source of a (regression) bug?
What is the difference between git vs svn
What is ‘head’ in git?
What is the difference between git and github?
What is ‘git status’ is used for?
What is git cherry-pick?
What is the function of ‘git config’?
Explain the advantages of forking workflow?
Explain git stash, pop?
What does ‘hooks’ consist of in git?
What is ‘bare repository’ in GIT?