git rebasing - rewrite history

In this post, I am going to discuss a scenario where I had to use “git rebasing” for something other than squashing commits. Lets build up from the starting, I am going to use a short form “CR” for code review. When I have to work on a feature, I generally cut a branch from the mainline and start development on it. git checkout -b feature-branch-101 The above command will create a branch named “feature-branch-101” and make it the current branch. I start implementing the feature. Let’s say I made a commit (Commit A) and raised a CR corresponding to that commit. And continued development, till the CR comments came I did 2 more commits (Commit B and C). Now the repository scenario is something like below. ...

January 8, 2021 · 4 min · Vivek Bhadauria