私は、マスター ブランチと別のトピック ブランチを持つ git リポジトリに取り組んでいます。トピック ブランチに切り替えて、ファイルを変更しました。ここで、master ブランチに切り替えると、同じファイルが変更済みとして表示されます。
例えば:
git-build ブランチの git ステータス:
# On branch git-build
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: cvsup_current
#
master ブランチに切り替える
[root@redbull builder_scripts (git-build)]# git co master
M builder_scripts/cvsup_current
Switched to branch "master"
マスター ブランチの git ステータス
[root@redbull builder_scripts (master)]# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: cvsup_current
#
ファイルが git-build ブランチで変更されたにもかかわらず、マスター ブランチで変更されたと表示されるのはなぜですか?
私の理解では、ブランチは互いに独立しており、あるブランチから別のブランチに変更しても、変更はあるブランチから別のブランチに「波及」しません。だから私は明らかにここに何かが欠けています。
手がかり棒を持っている人はいますか?