Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to squash or fixup commits?



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

Post New Answer

More Git Interview Questions

Name a few git commands?

1 Answers  


What is git bisect? How can you use it to determine the source of a (regression) bug?

1 Answers  


What is the difference between git vs svn

1 Answers  


What is ‘head’ in git?

1 Answers  


What is the difference between git and github?

1 Answers  


What is ‘git status’ is used for?

1 Answers  


What is git cherry-pick?

1 Answers  


What is the function of ‘git config’?

1 Answers  


Explain the advantages of forking workflow?

1 Answers  


Explain git stash, pop?

1 Answers  


What does ‘hooks’ consist of in git?

1 Answers  


What is ‘bare repository’ in GIT?

1 Answers  


Categories