修改后的文件出现在Git中但未更新的问题? [英] Problem with modified files showing up in Git but not updating?

查看:1409
本文介绍了修改后的文件出现在Git中但未更新的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 #在分支master $ b上有一些文件/文件夹不会离开Git临时区域$ b#已更改但未更新:
#(使用git add< file> ...更新将提交的内容)
#(使用git checkout - < file> ;. ..放弃工作目录中的变化)
#(提交或放弃子模块中未跟踪或修改的内容)

#modified:JavaScript / Stand.ard.iz.er(modified内容,未跟踪内容)
#修改:网站(未追踪内容)
#修改:模板档案/模板(修改内容,未追踪内容)
#修改:模板档案/ Template_Git(修改内容,未跟踪的内容)

我已经尝试了所有提交这些'modified'文件但没有运气?



我试过...

  git add。 
git add *
git add -u
git add {实际完整目录路径}

...但没有一个能起作用。



有什么想法? p

谢谢。

解决方案

这些可能是子模块,在这种情况下,它们的状态将从家长回购。



除非你使用 - ignore-submodules [=< when> git status 的选项:


在寻找更改时忽略对子模块的更改。

< when> 可以是 none 未跟踪全部,这是默认值。




  • 使用 none 将考虑子模块当其包含未跟踪或已修改的文件或其 HEAD 与超级项目中记录的提交不同时可进行修改,并且可用于覆盖 git-config gitmodules 当使用 未跟踪 时,子模块仅包含未跟踪内容时不会被视为脏他们仍然被扫描修改的内容)。 使用 忽略对子模块工作树的所有更改,只更改提交显示存储在超级项目中(这是1.7.0之前的行为)。 使用 所有 隐藏对子模块的所有更改(并禁用子模块摘要的输出 config选项status.submodulesummary 已设置)。

在任何情况下,您都需要在子模块本身内添加和提交,然后才能升级到一个级别(在父级回购级别),并查看干净状态。 p>

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.

解决方案

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:

Ignore changes to submodules when looking for changes.
<when> can be either "none", "untracked", "dirty" or "all", which is the default.

  • Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config or gitmodules.
  • When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content).
  • Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior before 1.7.0).
  • Using "all" hides all changes to submodules (and suppresses the output of submodule summaries when the config option status.submodulesummary is set).

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中但未更新的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆