【发布时间】:2019-08-03 04:57:37
【问题描述】:
我在 Visual Studio 2017 上做了以下测试:
1) 使用 master 分支创建了新的 repo:
它只有一个 gitginore 文件:
2) 使用 file1 创建 Branch1:
3) 再次结帐 master 分支,并打开“显示文件夹视图”:
为什么我会在 master 分支中看到 file1?
【问题讨论】:
-
您是否将 File1 提交到 Branch1?如果您没有将此文件提交到分支,则您所描述的行为是预期的。在当前状态下,File1 是一个未提交的更改,并且在您更改分支时将保持不变,假设您要更改的分支上没有冲突更改。
-
谢谢,看来我毕竟错过了提交。我正在从使用命令行 git(用于 java)过渡到 Visual Studio 上的 Azure Devops 'git' Repos,看到这种行为感到很沮丧。
标签: git version-control visual-studio-2017 azure-devops git-branch