LoginSignup
678
604

More than 5 years have passed since last update.

git コマンド branchの作り方

Last updated at Posted at 2014-05-19

ローカルのブランチからブランチを作成する方法

ブランチを作りたいgitのディレクトリに入る

cd ディレクトリパス

ブランチの一覧を見る

git branch -a

ブランチを作る元のブランチに切り替える

git checkout master

ブランチを作成

git checkout -b 作成するブランチ名

ブランチの一覧を見る

git branch -a

ブランチをリモートに登録

git push -u origin 作成したブランチ名


リモートブランチから作る方法

リモートブランチからローカルブランチを作成

git checkout -b ローカルに作成するブランチ名 origin/作成元のリモートのブランチ名

ブランチの一覧を見る

git branch -a

ブランチをリモートに登録

git push -u origin 作成したブランチ名

678
604
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
678
604