Skip to content

Instantly share code, notes, and snippets.

@everpeace
Created April 24, 2012 13:55
Show Gist options
  • Save everpeace/2479828 to your computer and use it in GitHub Desktop.
Save everpeace/2479828 to your computer and use it in GitHub Desktop.
git log --graph のコミットハッシュ値を全部相対表現で表示する
$ git log --graph --oneline
*-. 9010104 Merge branches 'master3' and 'master2'
|\ \
| | * dd0ba6d add b2
| * | 75a99a0 add b3
| |/
* | 743ad3b add b1
|/
* 81b919d add a
(↓相対表現しておくとbranch tip以外のコミットをcheckoutするときにしやすい。)
$ git log --graph --pretty=oneline |git name-rev --stdin --name-only
*-. master Merge branches 'master3' and 'master2'
|\ \
| | * master2 add b2
| * | master3 add b3
| |/
* | master~1 add b1
|/
* master2~1 add a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment