Add to a Previous Git Commit
This happens to me often when I'm refactoring. I'm going through, wiping out unnecessary files, cleaning up code, and just conquering the world. After it's all done, I'm always pleased to put a bow on it.
*cracks knuckles*
$ git add . $ git commit -am "yeah, you're welcome, I'm awesome."
Well, it always happens, I'm all done, and then I remember, "I forgot to remove pointless_config_thing.rb".
So I go delete that file, and now I feel stupid because I have to do this:
$ git add . $ git commit -am "my bad, forgot this stupid config now my sexy commit is ruined"
Now when you look at my GitHub you see this:
GIT AMMEND TO THE RESCUE!!!
Instead of all of that, just do this:
$ git commit --ammend
Yeah, it's that simple. Now, no one will know you are a forgetful loser (I'm being a little hard on myself) and you can keep on keeping on. You're welcome.













