Skip to content

Instantly share code, notes, and snippets.

@mogproject
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogproject/941c080981b108eee943 to your computer and use it in GitHub Desktop.
Save mogproject/941c080981b108eee943 to your computer and use it in GitHub Desktop.
Git Cheat Sheet

Git Cheat Sheet

  • リモートブランチをローカルに取得してチェックアウト
git checkout -t -b branch_name origin/branch_name
  • 直前コミットの author を修正
git commit --amend --author="Your Name <your_address@example.com>"
  • git push の時に、自動的に現在のブランチが対象になるようにする
git config --global push.default current
  • リモートブランチの削除
git push --delete origin branch_name
  • コマンドのエイリアスを設定する (checkout => co の例)
git config --global alias.co checkout
  • アップストリームの確認と設定
git branch -vv

git push -u [origin branch_name]
  or
git branch --set-upstream-to=origin/branch_name branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment