我正在使用git存储库连接到github的文件夹中的一个有角度的应用程序。每次我执行git commit时,都会收到以下消息,提示主文件夹未暂存:
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
parcelFrontEnd是Angle-app文件夹的名称,位于git存储库所在的文件夹内,因此所有“肉”都位于parcelFrontEnd文件夹内。
我不确定为什么会这样。
我已经完成:
git add .
git commit -m "....."
git push -u origin master
但是它不断给我以下信息:
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
我什至尝试直接使用“ git add parcelFrontEnd”添加文件夹,但仍然无法正常工作。
这不是一个空文件夹,其中有很多文件。
我读过的所有解决方案都说做“ git add”。添加所有内容,但是我已经做了很多次,但仍然会遇到相同的错误。
下面是我的终端窗口的内容:
no changes added to commit (use "git add" and/or "git commit -a")
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add .
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "getting error about changes"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add .
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "what is going on"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add parcelFrontEnd
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "parcelFrontEnd edited"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git stash list
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add .
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -a "commiting before updating angular"
fatal: Paths with -a does not make sense.
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git stash
No local changes to save
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add .
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "typo"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add .
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "test"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git add parcelFrontEnd
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$ git commit -m "having trouble"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
modified: parcelFrontEnd (modified content)
no changes added to commit
(base) Admins-MacBook-Pro:Parcel-Forwarding-Platforms admin$
答案 0 :(得分:0)
答案:
我不确定是什么问题。子文件夹中可能还有另一个git存储库,这意味着我在主存储库中嵌套了一个git存储库,称为“子模块”。
我打开子文件夹,到处寻找隐藏文件,找到一些扩展名为.git的文件并将其删除。
如果我走得更远,这可能已经解决了问题,但是我决定只删除本地存储库和github存储库,然后重新制作两者。无论如何,我只做了两个小的提交。