git : Files are not getting added to the staging area

标签 git git-bash

我已将包含一些文件的外部文件夹复制到我的存储库

Added this new folder having content inside 之后我运行 git status 并显示修改后的文件符合预期

enter image description here

..我运行 git add .

enter image description here

..它没有显示任何错误。然后我再次运行 git status 来检查文件是否已添加到暂存区

enter image description here

文件未移动到暂存区域。为什么不将此文件夹移动到暂存区域?我如何将其移动到暂存区?

最佳答案

jobtest 是一个 submodule ,不是普通文件夹。

您需要:

  • 进入jobtest,添加、提交、推送,
  • 然后返回到父存储库,添加、提交并推送(记录新的 gitlink ,它代表 jobtest 存储库的 SHA1)。

正如我在“Git diff says subproject is dirty”中所解释的,要获得干净的状态(忽略子模块状态),您需要:

git status --ignore-submodules=dirty

关于git : Files are not getting added to the staging area,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26190664/

相关文章:

python-3.x - Windows Gitbash 上的权限被拒绝错误 : Python 3. 8

windows - 为什么 `gcloud init` 没有显示所有文本?

git - 在 Git 中更改用于推送的凭据

git - Maven 发布插件 git 凭据

javascript - 未捕获( promise 中)类型错误 : Failed to Fetch - In Service worker when offline

python 在 git bash 中记录到 stdout

anaconda - conda init 在 Windows 上的 bash 中不起作用

python - 无法在 Windows 的 GIT bash mingw32 中激活 virtualenv

asp.net - git 版本号 C#

git - 强制所有行尾到LF的git