/ Published in: Bash
URL: http://cheat.errtheblog.com/s/git/
We can fix commits that we made by using --amend option.
Expand |
Embed | Plain Text
# we have a change ronen@Lunar:~/dummy$ gits # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: bla # no changes added to commit (use "git add" and/or "git commit -a") ronen@Lunar:~/dummy$ gitc 'added a wrong change' [master 14af00a] added a wrong change 1 files changed, 1 insertions(+), 0 deletions(-) ronen@Lunar:~/dummy$ gits # On branch master nothing to commit (working directory clean) # weve made a bad commit ronen@Lunar:~/dummy$ cat bla initial value wrong change to make # lets fix that (we replace it with an empty line ronen@Lunar:~/dummy$ vi bla ronen@Lunar:~/dummy$ cat bla initial value <-- this is an empty line! ronen@Lunar:~/dummy git commit --amend bla
You need to login to post a comment.
