发生错误.详细信息:没有变化; 没什么可承诺的.Visual Studio Online

Ayk*_*KAN 5 git visual-studio-2015 azure-devops

我向Web应用程序解决方案添加了一个类库项目.我收到错误消息"发生错误.详细消息:没有更改;没有提交." 我在visual studio上使用git repository.

Dre*_*Rat 8

当GIT忽略文件或文件夹时,我在VS2013中看到了这个错误.您可以通过从命令行尝试添加来确认这一点.

例如,以下显示了TestGit项目的"bin"文件夹:

$ git add bin
The following paths are ignored by one of your .gitignore files:
TestGit/bin
Use -f if you really want to add them.
fatal: no files added
Run Code Online (Sandbox Code Playgroud)

如果您确认是问题,则需要检查.gitignore,.git/info/exclude等并修复设置.你可以找到使用git check-ignore的文件,如下所示:

$ git check-ignore -v bin
.gitignore:190:bin      bin
Run Code Online (Sandbox Code Playgroud)

此示例显示.gitignore文件需要的第190行导致bin文件夹被忽略.修复此允许将允许添加该文件夹(或其中的文件).

注意:我为此示例添加了"bin"到.gitignore; 它不是Visual Studio创建的.gitignore文件的一部分.

*更新:我甚至不需要添加该行.Visual Studio添加的.gitignore已经排除了"bin"文件夹.有关更多详细信息,请参阅github/gitignore/VisualStudio.gitignore.