Pages

Friday, September 12, 2014

Simple git rebase example

Situation:

So I forked the Google Kubernetes project.  Then I created a fedora_gs_guide branch.  I made some changes to the getting started guide and then I submitted a pull request.  I asked someone to review it and they had a couple of changes.  So, I make the changes, and commit.  Now when I look at the PR, I see multiple commits.  I think it's best practice to squash all those commits into one if possible.  So, how do you do that.  Well, here's how I did it.  I'm sure there are other ways to do this, probably a lot more efficiently (comments welcome).  But, it worked.  These are my notes from the process.

I needed to make sure my master and fedora_gs_guide branch were clean and rebased to upstream master.

Make sure I'm on my local master.

$ git checkout master