1

https://www.kernel.org/pub/software/scm/git/docs/git-checkout.htmlのドキュメントによると:

git checkout <branch>

  If <branch> is not found but there does exist a tracking branch in exactly
  one remote (call it <remote>) with a matching name, treat as equivalent to

    $ git checkout -b <branch> --track <remote>/<branch>

その後、たとえば(発信元git checkout project/phpunit/trunkの単一のリモートから)電話をかけると、実行すると次のようになります。git remote show origin

Local branches configured for 'git pull':
  master                merges with remote master
  project/phpunit/trunk merges with remote project/phpunit/trunk
Local refs configured for 'git push':
  master                pushes to master                (up to date)
  project/phpunit/trunk pushes to project/phpunit/trunk (up to date)

ただし、ローカルブランチをあまり言葉にしないものと呼びたい場合は、git checkout -b phpunit --track origin/project/phpunit/trunk代わりに、このドキュメントが示唆していることに基づいて、次のようになりgit remote show originます。

Local branches configured for 'git pull':
  master  merges with remote master
  phpunit merges with remote project/phpunit/trunk
Local ref configured for 'git push':
  master pushes to master (up to date)

一言で言えば、引っ張るための追跡はそのままですが、押すための参照の作成はそうではありません。

使用方法にこの違いがあることは必ずしも気になりませんが、この不一致の理由について、gitの知識に何が欠けているのかを知りたいと思います。

リモートで追跡されたブランチに基づいて新しいローカルブランチを作成およびチェックアウトする方法があるが、別のローカル名で名前を付ける場合:その方法は何ですか

読んでくれてありがとう。

4

0 に答える 0