Skip to content

Git Note

Quick start#

Add to last commit#

  • @2021-08-24
  • with git commit amend

Change committed files#

from [https://www.atlassian.com/git/tutorials/rewriting-history]

1
git commit --amend --no-edit

Edit commit note#

1
 git commit --amend -m "New message"

The New message can be multiple lines. Use Ctrl+Enter to enter multiple line mode and just write another " to leave this mode. Using a pair of \backtick and \singlequote will interfere the leaving mode detection.

Download origin/master#

  • @2021-08-24
1
2
git pull
git checkout master

Git ignore#

Unignore subdirectory#

  • @2021-11-26
1
2
dir/      # same as `dir`, same effect as `dir/*` in most cases.
dir/*/**  # this wont ignore dir/file
  • @2021-12-11

Git release notes#

Funny commit message collection#

first commit#

  • @ 2021-11-26
  • Let there be light.
  • Big bang

Git Graph#

  • @2021-12-17
  • git log --all --decorate --oneline --graph

Revert merge#

  • @2021-12-17
  • git revert --no-commit -m 1 cd1550e
  • -m = `--mainline \```
  • git-revert

Prune local branches#

Restore deleted branches#

Move commit between branch#