我有兩個分支,主BR1和BR2。現在,我做了以下git狀態顯示令人困惑的結果
git checkout BR1
git submodule add <submodule1_repo_url> path/to/submodule1
git submodule add <submodule2_repo_url> path/to/submodule2
git add path/to/submodule1
git add path/to/submodule2
git commit -m "Some commit msg"
當我做了git status
現在,我看到我的改變是承諾並沒有什麼承諾。
現在,當我切換到BR2並執行git status
時,我看到path/to/submodule1
和path/to/submodule2
顯示爲未跟蹤文件。重點是我在BR1中添加了這些子模塊。爲什麼它們在BR2中顯示爲未被跟蹤,我如何確保它們在BR2中未被追蹤,因爲我不想在BR2下提交這些子模塊。
任何幫助,將不勝感激。
編輯:中git status
上BR1
On branch BR1
nothing to commit, working tree clean
的git status
輸出 輸出上BR2
On branch BR2
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
path/to/submodule1/
path/to/submodule2/
nothing added to commit but untracked files present (use "git add" to track)
請顯示'git status'的**確切**輸出以及您的口頭解釋。 –
在提交了BR1上的更改後,在兩個分支上添加了'git status'的確切輸出。 – thisisshantzz