Posted on 2012-11-29
Commit Chunks in Magit
If you work on one of your versioned files you might end up with something like this:
There are changes in different places in the file but to create a cleaner commit you just want to commit some of them.
To do so one could use
-p. As many posts state this is a pretty complicated command so you probably don’t want to do that if not really necessary.
Magit to the rescue!
Just select the stuff you want to stage in the Magit diff and press
s like you would do in the normal stage process. That’s all. Easy, right?
Here is a look after a chunk is staged.