【问题标题】:Can not commit to local repository after making changes ( Visual Studio 2015 (Community) )进行更改后无法提交到本地存储库(Visual Studio 2015(社区))
【发布时间】:2016-05-06 15:30:47
【问题描述】:

我创建了一个本地存储库来代替我的解决方案,在 github 中创建了一个远程存储库,进行了提交,然后将提交推送到 github 远程存储库。好的,很好。 之后我对代码进行了一些更改,并希望将它们发送到 github, 所以首先我应该找到一个提交按钮来提交对本地仓库的更改,之后我怀疑我需要将它推送到远程。 但我找不到提交按钮。相反,在解决方案资源管理器右键菜单中的源代码管理子菜单中,我只能看到查看历史记录,与未修改(灰色)和注释比较 没有提交。

如果我进入团队菜单并进行更改,那里有一个带有文本字段的提交按钮,用于写下提交消息,但即使我输入消息,此按钮也会被禁用。谁能帮我解决这个问题?谢谢

回答下面我输入的第一个请求 git status 在命令提示符下,这就是我所拥有的

D:\Projects\AsmParser>git status
On branch master
Your branch is up-to-date with 'origin/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:   AsmOperand.cpp
        modified:   AsmOperandParser.cpp
        modified:   AsmOperandParser.h
        modified:   AsmOperandParserUnitTest.cpp
        modified:   AsmOperandUnitTest.cpp
        modified:   AsmRegisterUnitTest.cpp
        modified:   main.cpp

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        AsmParser.VC.opendb
        AsmParser.rar

no changes added to commit (use "git add" and/or "git commit -a")

我想我可以用命令行完成所有肮脏的工作。我仍然对 Visual Studio 问题感兴趣

【问题讨论】:

  • 你能帮我一个忙并在命令提示符下输入git status 吗?我怀疑你修改的文件没有被添加到 Git 索引中。
  • 你保存文件了吗?或 Visual Studio 仍然在文件上显示 * 表示文件未保存,因此 git 将没有任何要提交的内容。
  • 蒂姆,问题中的更新结果

标签: git github git-commit


【解决方案1】:

在我看来,您缺少Add 步骤。我没有使用 Visual Studio 源代码控制集成功能,但必须有一种方式表明您想要记录更改,然后才能实际提交。

尝试在命令提示符下输入git add -u(添加所有修改过的文件,但不添加新文件),然后检查您是否能够从 Visual Studio 提交。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-30
    • 1970-01-01
    • 2017-08-25
    • 2017-03-27
    • 1970-01-01
    • 2016-08-09
    • 1970-01-01
    相关资源
    最近更新 更多