git - 发生错误。详细消息 : No changes; nothing to commit. Visual Studio Online

标签 git visual-studio-2015 azure-devops

我向 Web 应用程序解决方案添加了一个类库项目。我收到错误消息“发生错误。详细消息:无更改;无需提交。”我在 visual studio online 上使用 git 存储库。

最佳答案

当 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

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

$ git check-ignore -v bin
.gitignore:190:bin      bin

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

注意:对于这个例子,我在 .gitignore 中添加了“bin”;它不是 Visual Studio 创建的 .gitignore 文件的一部分。

*更新:我什至不需要添加这一行。 Visual Studio 添加的 .gitignore 已经排除了“bin”文件夹。参见 github/gitignore/VisualStudio.gitignore了解更多详情。

关于git - 发生错误。详细消息 : No changes; nothing to commit. Visual Studio Online,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32417729/

相关文章:

javascript - 有关使用客户端凭据 One Drive 访问 MS Graph 的问题吗?

azure - Wix 工具集 Candle 变量在 Azure Pipelines 中未定义

windows - 使用 windows 通过 ssh 连接到 github

c# - VS2015CE 中 <para></para> 和 <para/> 显示的额外空行,无法消除

android - Visual Studio Enterprise 2015 RC Cordova Android 构建退出代码 1

c# - Visual Studio : The Operation could not be completed. 参数不正确

git - 提交显示在历史记录中,更改不在文件中并且不显示在单个文件提交历史记录中

git - 检查是否所有对一个 GIT 分支的提交都被挑选到另一个分支

git 恢复到某个提交

continuous-integration - 在网页上显示构建版本