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

What is git fork? What is the difference between fork, branch, and clone?

1 Answers  


How to revert previous commit in git?

1 Answers  


What is a “conflict” in git and how is it resolved?

1 Answers  


What is subgit and why is it used?

1 Answers  


What is the purpose of branching and how many branching strategies can you apply?

1 Answers  


What is GIT stash drop?

1 Answers  


In git, how would you return a commit that has just been pushed and made open?

1 Answers  


Distinguish between git fetch and git pull?

1 Answers  


What is a commit message?

1 Answers  


What is git reflog?

1 Answers  


What are the different ways you can refer to a commit?

1 Answers  


What is the use of ‘git log’?

1 Answers  


Categories