Skip to content

Instantly share code, notes, and snippets.

@sotayamashita
Last active August 29, 2015 14:27
Show Gist options
  • Save sotayamashita/3a467fcbc3cff7c0688d to your computer and use it in GitHub Desktop.
Save sotayamashita/3a467fcbc3cff7c0688d to your computer and use it in GitHub Desktop.
:octocat: Git / GitHub Cheat Sheet

目次

いつ誰が作った branch なのかを知る方法

$ git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -k5n -k2M -k3n -k4n

Mon Jul 15 15:45:10 2013 +0800   Cheng Zhao      refs/tags/v0.1.0
Wed Jul 17 10:57:25 2013 +0800   Cheng Zhao      refs/tags/v0.1.1
Thu Jul 18 18:37:40 2013 +0800   Cheng Zhao      refs/tags/v0.1.2
Thu Jul 18 19:21:25 2013 +0800   Cheng Zhao      refs/tags/v0.1.3
...

brach の派生元確認方法

# 例:branch b が branch a のどこから派生したか確認
$ git show-branch --sha1-name <branch a> <branch b> | tail -1

*+ [fe1efe2] Branch from master to develop

今日何したか確認する方法

git log --since="10am" --author="$(git config user.name)"  --format="%C(blue)%ad: %C(green)%h %C(reset)%s"

* 2015-01-22: 81dd193 commitA
* 2015-01-22: 12d1653 commitB

License

Creative Commons License
Git Cheat Sheet by Sota Yamashita is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment