Skip to content

Instantly share code, notes, and snippets.

@rkaneko
Last active August 29, 2015 14:06
Show Gist options
  • Save rkaneko/0e1e0a20f333039d7c29 to your computer and use it in GitHub Desktop.
Save rkaneko/0e1e0a20f333039d7c29 to your computer and use it in GitHub Desktop.
Git & GitHub memo

Gitに関するメモ

Tips

# commit logをフォマット指定して見る
$ git log --pretty=format: "%h %cd %cn %s"
# print log formatted ${commit hash short version} ${date} ${author} ${commit message}

# git stash working tree を一時退避
$ git stash save "stash some-branch's commits"
# list stash
$ git stash list
stash[{0]: On some-branch-name: stash some-branch commits"
# apply and remove from stash's list
$ git stash pop [(optional)stash@\{0\}]
# only apply without removing from stash's list
$ git stash apply [(optional)stash@\{0\}]

# remove stash of stash@{0}
$ git stash drop
# remove all stash list
$ git stash clear

# git の他branchの特定コミットのみマージ
$ git cherry-pick <commit-id>

etc

# exclude .git to make dist
$ git checkout-index -a -f --prefix=here-is-dist-directory-name/

GitHubに関するメモ

  • diff Viewer
    • Q1. 任意のコミット間でのdiffをみるには?
    • Q2. コミット差分にスペースによる差分を表示させなくするにはどうしたら良い?→GETパラメータw=1をつける。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment