Splitting commits using git rebase

We have all been there before: you’re working on a big feature branch, committing all over the place and then at some point you need to extract something out to merge it back to the main (or develop) branch. My usual to method is to split off a new branch and then use git rebase to keep only the commits of the parts that I want to extract out and merge that back after which I then rebase my feature branch on the target branch again.

But what if you find that some commit halfway through the changeset needs to be split up? That’s what I will be diving into in this article.

Continue reading “Splitting commits using git rebase”

Committing parts of your changes via the git command-line interface

If you have ever used made extensive use of GUI interfaces for git you may have come across the ability to stage and commit only parts of your changes to files rather than committing everything that you changed in said files at once. Recently I learned that the command-line interface to git supports the same feature using the -p flag when staging or even committing files which is what I briefly want to go through in this article.

Continue reading “Committing parts of your changes via the git command-line interface”