gnapse corner

web for everyone

Oops!

You made a mistake? No problem, with Git you can rewrite history!

I made a mistake in my last commit and I figured that out too late. Well, not late enough, because thanks to git I was able to amend my last commit with whatever new changes I wanted and git's commit history appeared as if the mistake was never there.

Here is how it works.

You commit and then you figure out you made a mistake, maybe a mispelled word in your commit message or even a programming error, whatever. So you change whatever you want, add the relevant stuff to your index with "git add" and then

$ git commit --amend

which opens your editor with the message of your last commit pre-loaded, which you can edit if you need and then save it. That's it. Your new changes will appear as if they were always there on that last commit, no new commits in your history with the fixes of your mistakes.

I LOVE GIT!!!

Resuming my tech (b)logGmail 2 now works in Opera!

Comments

Fatimahzenya Wednesday, June 25, 2008 11:09:22 PM

where do you get " GIT" bigsmile

Unregistered user Saturday, March 27, 2010 11:52:27 PM

Ðноним writes: Different students have got lots of deals but in spite of of it they still have to create the sports essay. But at this moment they should not worry about it, because they would take your solid issue related to this good post as a sample for papers writing. Another way, that seems to be achievable to come to essayscentre.com to purchase the apa research paper. Furthermore, this is very comfortable.

Write a comment

New comments have been disabled for this post.

May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31