shimgo
10/30/2016 - 8:59 PM

git checkout まとめ

git checkout まとめ

###特定のバージョンに戻る

git checkout <コミットハッシュ>

もとのバージョンに戻りたいなら

git checkout <もとのブランチ>

###特定のバージョンのファイルを取得する

git checkout 8f87b8a /path/to/xxx.php

###ブランチを作成してそのブランチに切り替える

git checkout -b [branch name]

ベースを指定してブランチ作成&切り替え

git checkout -b [new branch name] [base branch name or commit]

リモートブランチをローカルにチェックアウト

git checkout -b new_local_branch_name origin/other_branch