LoginSignup
1
1

More than 5 years have passed since last update.

新しいbranchがリモートリポジトリに作られた時に共有する方法

Posted at

git pullしてもbranch取ってこれなくてはまったのでメモ

リモートリポジトリにあるbranchを確認

まずリモートリポジトリにあるbranchを確認する。
git branchに-aをつけると見れなかったbranchも見れるようになる。

branchを確認
$ git branch
* master        #ローカルにはmasterブランチしかない
$ git branch -a
* master
  remote/origin/develop    #リモートにdevelopブランチがある

ローカルにbranchを取ってくる

git branch <ローカルブランチ名> <リモートブランチ名>とすることでローカルにリモートブランチを取ってくることができる。

$ git branch develop origin/develop
Branch develop set up to track remote branch develop from origin
$ git branch
* master
  develop

1
1
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
1
1