Pages - Menu

Sunday, February 24, 2013

Forgot to add files and made a commit?

It happens to me frequently, I make a commit and just after that I remember that there are some files that I left behind.

The solution is pretty simple: amend

git commit --amend -C HEAD

The detail is that you can use it with -C or -c (I hope you noticed the capital).

The -C uses the last commit message and author stuff and commit again but with your forgotten files.

The -c will let you set a new message.

Easy breezy.

Be happy.

No comments:

Post a Comment