git rebase with squash

Git is a very powerful tool for source code version control. Often we do POCs and no one whats to waste time while you are doing a POC so often people dont pay much attention to their commit messages(including myself). However the POC grows and you reach the point to productionize the solution, all great but what you do with your poor commit messages? Good messages are critical for good configuration management, release management, and code hygiene. So what can we do? Well git rebase can rescue us. Git rebase is also useful in other use cases where you need to have a specific format of messages because your CI/CD tool does some validations or you are hunting a bug down and you want to drop a bad commit or you are cherry-picking commits to doing a chirurgical release. So I made a short video showing rebase commands in action. We also will use squash which is an interesting way to combine your commits in one for better trackability. So Let’s get started.

The Video

The Commands

Cheers,

Diego Pacheco

Originally published at http://diego-pacheco.blogspot.com on March 5, 2021.

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. diegopacheco.github.io (Opinions on my own)

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