How To Combine Git Commits — Rebase And Squash

$ git log --oneline  
c123456 Edit file-B again
b234567 Edit file-B
a012345 Edit file-A
pick b234567 Edit file-B  
squash c123456 Edit file-B again
  • :wq — to save and exit
  • :q — exit without saving
  • i — to enter Insert mode
  • Esc — to enter Command mode from Insert mode




Software Engineer at Atlassian

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Proof of Steak: October 2020 Rewards Distributed

RISC-V in 5 days!!!

Integration (ML + DEVOPS =MLOPS) using Jenkins

working of ml model

Tech Challenges: meet Emmanuel Sablone, Product Manager at Voodoo

You Don’t Have To Be Brilliant To Learn How To Code

How to Enter a Promo Code in

Create a Migration in Rails Manually

Setup GIT Repository in Ubuntu 20.04 VPS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sachithra Dangalla

Sachithra Dangalla

Software Engineer at Atlassian

More from Medium

Docker, how to start with it

Basics of Git for a QA Engineer

Docker For Developers

What you need to know about git rebase and git merge as a beginner