git-commit --amend
One of the benefits of using version control is organization. When you commit a set of changes, you are implicitly marking that set as defining a certain feature set, or otherwise having something in common.
Have you ever committed something, then realized you forgot to include something with it? Maybe it's a new file, or maybe it's an extra small change you forgot to make.
Enter git-commit --amend. The amend option adds to
the tip of the current branch, and actually replaces the last
commit with the combined change! It even seeds the message
editor with the last commit's description, so you don't have to type
it in again.
Find out two other lovable git qualities in the full version of Three Things I Love About Git
2 comments:
git add --patch is a quicker and simpler form of --interactive, and supports all the same options.
Darcs is also capable of committing individual file hunks, and the darcs record command is much easier to use than git-commit.
In fact the whole of darcs is just a lot more usable than git...
Post a Comment