首页 > 解决方案 > Git 提交和推送错误未暂存提交的更改:

问题描述

我在提交和推送客户端时遇到问题,我收到此错误:

On branch VersionOne
Your branch is up to date with 'origin/VersionOne'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
        modified:   client (modified content)

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

在我从客户端推送我的文件之前,但是我创建了后端文件并且无法从客户端提交它,所以我在顶级目录中创建了新分支并添加了它们,客户端没有推送。

标签: git

解决方案


我通过移动到作为内部存储库或子模型的客户端文件夹来解决这个问题,并通过以下方式删除所有 git 文件:

  1. 窗口中的cmd
  2. cd到我的项目
  3. 运行德尔/F /S /Q /A .git
  4. 在根文件夹中再次初始化 git 并打包所有内容

注意:确保为任何情况备份所有内容


推荐阅读