4

新しいブランチを作成することを考えたとき、私は「マスター」ブランチにいました。

$ git checkout -b od_newstructure
Switched to a new branch 'od_newstructure'

いくつかの変更をコミットし、この新しいブランチをリモートに追加して追跡を開始しました

$ git commit
$ git branch -u origin/od_newstructure
Branch od_newstructure set up to track remote branch od_newstructure from origin.
$ .. some other work including git pull and git push

私は今、マスターに戻りたいと思っていました。だから私はやった

git checkout master
Switched to branch 'master'

しかしその後、master は origin/master をもう追跡していないようでした!

$ git branch -vv
* master          d1db2e3 Subdivided into several namespaces
  od_newstructure d1db2e3 [origin/od_newstructure] Subdivided into several namespaces

git pullでも検証済み

$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

私の質問は、新しい追跡ブランチに切り替えたときに、以前の追跡ブランチの追跡情報が失われたのはなぜですか? これはデフォルトで適切な動作ですか? git branch -u追跡ブランチに切り替えるたびにアップストリームを追加する必要がありますか?

4

0 に答える 0