LoginSignup
72
44

More than 5 years have passed since last update.

origin masterとorigin/masterの違い

Posted at

例えばよく使うgitコマンド

git fetch origin develop
git merge origin/develop

で、origin developorigin/developの違いは分かりますでしょうか。

origin develop

originはリポジトリの名前でdevelopはブランチの名前になります。
デフォルトの設定の場合、originというリモートリポジトリのdevelopブランチを表します。

origin/develop

origin/developはリモートリポジトリのdevelopを追跡するリモート追跡ブランチです。

解説

git fetch origin develop

でリモートリポジトリoriginのdevelopブランチをローカルリポジトリのリモート追跡ブランチに落とします。

git merge origin/develop

ローカルリポジトリ内のリモート追跡ブランチdevelopよりローカルブランチにマージします。

リモート追跡ブランチは以下に分かりやすくまとめられています。
https://qiita.com/uasi/items/69368c17c79e99aaddbf

72
44
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
72
44