使用 git-cvsimport 后如何取消跟踪 CVS 文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4178726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I untrack CVS folders after using git-cvsimport?
提问by dkinzer
Possible Duplicates:
working with .git/info/exclude too late
.gitignore file not ignoring
git - removing a file from source control (but not from the source)
可能的重复:
使用 .git/info/exclude 太晚了
.gitignore 文件不忽略
git - 从源代码管理中删除文件(但不是从源代码中删除)
I have CVS/
in my both .gitignore
and my .git/info/exclude
files. But for some reason changes to any CVS folder are still tracked.
我CVS/
在我的两个.gitignore
和我的.git/info/exclude
文件。但出于某种原因,对任何 CVS 文件夹的更改仍会被跟踪。
I'm tired of having to manually un-stage changes in these folders.
我厌倦了在这些文件夹中手动取消暂存更改。
How do I make git stop tracking the CVS folders once it's decided to track them?
一旦决定跟踪 CVS 文件夹,如何让 git 停止跟踪它们?
回答by meagar
.gitignore
only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:
.gitignore
只会导致 git 忽略未跟踪的文件。“CVS”已被跟踪,因此您必须首先使用以下命令将其从存储库中删除:
git rm -r --cached CVS
The --cached
option causes git to leave the working copy of the file intact rather than removing it. Once done, the entry in .gitignore
will prevent git from interacting with the CVS directory again.
该--cached
选项会导致 git 保持文件的工作副本完好无损,而不是将其删除。完成后,输入.gitignore
将阻止 git 再次与 CVS 目录交互。
How do I make git stop tracking the CVS folders once it's decided to track them?
一旦决定跟踪 CVS 文件夹,如何让 git 停止跟踪它们?
Git will never "decide" to track content, it does only what you tell it to. At some point you manually added it to the index and then committed it to the repository.
Git 永远不会“决定”跟踪内容,它只会做你告诉它的事情。在某些时候,您手动将其添加到索引中,然后将其提交到存储库。