Skip navigation.

exploreopera

| Help

Sign up | Help

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

avatar
where do you get " GIT" :D

By zenya, # 25. June 2008, 23:09:22

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

Please type this security code : 7b49f8

Smilies

September 2008
MTWTFSS
August 2008October 2008
1234567
891011121314
15161718192021
22232425262728
2930