當我在git中的分支之間切換時,即使沒有更新,我也會看到文件被更改。這最近剛剛開始發生。在git中更改分支導致更改文件
$ git status
# On branch dev
nothing to commit (working directory clean)
$ git checkout master
Switched to branch 'master'
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: App.Core/ViewModels/CriteriaViewModel.cs
# modified: App.Core/ViewModels/UserManagement/AccountTagsViewModel.cs
# modified: App.Core/ViewModels/UserManagement/TagViewModel.cs
#
no changes added to commit (use "git add" and/or "git commit -a")
這些是文件,我在Dev分支改變,但加入並提交。任何關於我在做什麼的想法都會導致這種情況?
這特別奇怪,因爲除非您的更改被提交或隱藏,否則您不能切換分支。切換到'master'後沒有任何事情發生? –
@TimCastelijns - 我沒有意識到。 – Joe
你可以關閉VisualStudio,執行''git clean -f -x -d''並重復切換嗎? –