修改后的文件出现在 Git 中但没有更新的问题?
我有一些文件/文件夹不会离开 Git 暂存区域?
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: JavaScript/Stand.ard.iz.er (modified content, untracked content)
# modified: Site (untracked content)
# modified: Template Archives/Template (modified content, untracked content)
# modified: Template Archives/Template_Git (modified content, untracked content)
#
我已经尝试了一切来提交这些“修改”的文件,但没有运气?
我已经尝试过了……
git add .
git add *
git add -u
git add {actual full directory path}
但都不起作用。
有什么想法吗?
谢谢。
I've got some files/folders that just wont leave the Git staging area?
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: JavaScript/Stand.ard.iz.er (modified content, untracked content)
# modified: Site (untracked content)
# modified: Template Archives/Template (modified content, untracked content)
# modified: Template Archives/Template_Git (modified content, untracked content)
#
I've tried everything to get these 'modified' files commited but with no luck?
I've tried...
git add .
git add *
git add -u
git add {actual full directory path}
...but none of it works.
Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些可能是子模块,在这种情况下,它们的状态将从父存储库的状态中显示。
除非您使用 git 状态:
在任何情况下,您都需要从子模块本身内部添加和提交,然后才能上升一级(在父存储库级别)并查看干净状态。
Those could be submodules, in which case their status would be displayed from the status of the parent repo.
Unless, that is, you use the
--ignore-submodules[=<when>]
option of git status:In any case, you would need to add and commit from within the submodules themselves, before being able to go up one level (at the parent repo level), and see clean status.
如果您将一些新文件夹复制到项目中,并且其中已经有 .git 文件夹,则可能会发生这种情况。所以它就像主存储库中的子存储库。解决方案只需删除新复制的子文件夹中的 .git 文件夹即可。
This could happend if you've copy some new folder to your project which have already a .git folder inside. So it will be like a sub repository in your main repository. The solution is just delete this .git folder in your new copied sub folder.