English 中文(简体)
D. 工作名录的变更
原标题:Git discard changes in working directory submodule

我正在一个分层工作,在跟踪整个档案方面遇到麻烦。

$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
    #   modified:   public/javascripts/app/fckeditor/editor/skins/office2003/fck_dialog.css
    #   modified:   public/javascripts/app/fckeditor/editor/skins/office2003/fck_editor.css
    #   modified:   public/javascripts/app/fckeditor/editor/skins/silver/fck_dialog.css
    #   modified:   public/javascripts/app/fckeditor/editor/skins/silver/fck_editor.css
    #   modified:   public/javascripts/app/fckeditor/fckconfig.js
    #   modified:   public/javascripts/app/fckeditor/fckeditor.js
    #   modified:   public/javascripts/app/fckeditor/fckpackager.xml

第一类

git reset --hard

返回

欧洲复兴开发银行现在没有任何东西。

However when 第一类

git status

我再次对很长的档案清单表示问候。 我曾试图

git clean -f 

and also removed the entire submodule and checked out from the master server. I have also tried to delete the entire project whom the submodule belongs to, pulled that and then initiated and updated the submodule but to no avail.

rm -rf project
git clone foo@bar.project.net:/home/rails/repo/gits/project.com
#Cloning into project...
#remote: Counting objects: 2452, done.
#remote: Compressing objects: 100% (2040/2040), done.
#remote: Total 2452 (delta 1238), reused 582 (delta 145)
#Receiving objects: 100% (2452/2452), 561.32 KiB | 438 KiB/s, done.
#Resolving deltas: 100% (1238/1238), done.
cd project.com
git submodule init
git submodule update
#Cloning into vendor/plugins/project_engine...
cd vendor/plugins/project_engine
$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   public/javascripts/app/fckeditor/editor/skins/office2003/fck_dialog.css
#   modified:   public/javascripts/app/fckeditor/editor/skins/office2003/fck_editor.css
#   modified:   public/javascripts/app/fckeditor/editor/skins/silver/fck_dialog.css
#   modified:   public/javascripts/app/fckeditor/editor/skins/silver/fck_editor.css
#   modified:   public/javascripts/app/fckeditor/fckconfig.js
#   modified:   public/javascripts/app/fckeditor/fckeditor.js
#   modified:   public/javascripts/app/fckeditor/fckpackager.xml

似乎去除档案的唯一事情是,如果我对我的Mac说另一种用途,那么我就认为这个问题是我的当地机器,而不是背书本身。

我也试图停下来并重新加入全球投资机制,目前正在安装1.7.5.4美元,并得到了裁员的帮助(Ruby包装套人)。

我如何将这些档案从身份上删除?

最佳回答

我同意Richard的意见,即:could源自案件敏感性/敏感性问题。 我将回答这个问题。

<><>Problem

如果某个公司拥有两个档案,其名称只在个案中有所不同,则核对在案件敏感的档案系统中对工作目录作出承诺的情况会产生问题。 如承诺包含myfilemyFILE ,则git将创建myfile,然后在准备创建/更新myFILE时,档案系统可操作myfile>

如果我的档案和我的FILE在存放处有不同的内容,这一点就很明显。 在查证档案时,第二份“双赢”和实物档案载有第二份档案的内容。 当您填写git status时,指数中的两个文档都与工作名录中的同一档案进行了比较,而对于丢失的档案而言,内容不匹配。

www.un.org/Depts/DGACM/index_spanish.htm 核实问题

你可以检查一个敏感案件系统的存放处,以分析并解决那里的一切事项。 或者,优惠确实提供了足够的工具,在你目前的制度中处理这一问题。

很容易看出这一问题是否确实存在,就是对所列出的档案进行三边修改。 然后,如果运行<代码>git status,就应当显示档案名称的两种变数,因为工程版与指数中的两种版本不匹配:

$ echo >> public/javascripts/app/fckeditor/fckpackager.xml
$ git status
Possible outcome:
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   ...
#   modified:   public/javascripts/app/fckeditor/fckpackager.xml
#   modified:   public/javascripts/app/fckeditor/FCKPACKAGER.xml

或者,你也可以使用<代码>git ls-files,以了解该指数中的内容:

$ git ls-files public/javascripts/app/fckeditor/fckpackager.xml
public/javascripts/app/fckeditor/fckpackager.xml
public/javascripts/app/fckeditor/FCKPACKAGER.xml

如果你想确切了解每个档案中的内容,你可以使用<条码>giteckout-index,从索引中提取一个档案,并在某个地方节省(使用预先确定的内容,以便编成单独档案):

$ git checkout-index --prefix=v1/ public/javascripts/app/fckeditor/fckpackager.xml
$ git checkout-index --prefix=v2/ public/javascripts/app/fckeditor/FCKPACKAGER.xml

Resolution

如果你对你希望删除的每个档案中的哪一种变量进行了估算,你就可以将它从索引中删除,使用<代码>git rm-capple/code>,该索引尊重给它的道路:

$ git rm --cached public/javascripts/app/fckeditor/FCKPACKAGER.xml

然后实施,如有必要,还可采用<代码>git reset www.un.org/Depts/DGACM/index_spanish.htm


然而,你对作为不同用户的伐木和取得不同结果的评论表明,可能存在不同的问题。 因此,我会看到,用户专用档案是否有任何差异。

问题回答

为了清理未跟踪的档案,你应使用

-xdf

而不是

<代码>git Clean -f 仅限

-d Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.

-x Don’t use the ignore rules. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.

你可能会遇到一个案件敏感性问题。 缺席,澳门档案系统是保存案件,但并不敏感案件。

吉特本身是敏感的。 如果你没有案件敏感档案系统,而且只有两个档案被核对,其姓名仅因个案而有所不同,git status将显示一个经修改的档案(假设两个档案的内容不同)。 如果有2个directories 只有在个案(例如<代码>fckeditor<>/code>和FCKeditor)的情况下,Gite方可展示经修改的档案。

制作一个对案件敏感的卷册并运行<代码>git lin。

改用分层名录——这是自己的背书,然后由您对该分层进行操作。 那么,你就能够以通常的方式清理和确定分层座标。

各种分单元文章(progit & git 社区书)虽然提到了这一点,但却清楚表明了这一点。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签