当我在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''并重复切换吗? –