LoginSignup
12
9

More than 5 years have passed since last update.

gitでリモートブランチをローカルにチェックアウトしてくる

Posted at

いつもどうやるんだっけ?ってなるので備忘録です。

1. リモートに上がってるブランチを確認します。

git branch -a

* master
  remotes/origin/master
  remotes/origin/test

この時に対象のブランチが見当たらなければgit fetchをして、最新版のブランチを持ってくる。

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

ここでは、リモートブランチのorigin/testブランチをローカルにtestというブランチ名でチェックアウトすることにします。

git checkout -b test origin/test
12
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9