12
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?