如何在使用git-cvsimport后取消跟踪CVS文件夹? [英] How do I untrack CVS folders after using git-cvsimport?

查看:127
本文介绍了如何在使用git-cvsimport后取消跟踪CVS文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

使用.git / info /排除太晚

。gitignore文件不会忽略

git - 从源代码管理中删除文件(但不是来源)

我有 CVS / 在我的 .gitignore 和我的 .git / info / exclude 文件中。但由于某些原因,对任何CVS文件夹所做的更改仍会被跟踪。

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.

我厌倦了在这些文件夹中手动取消更改。

I'm tired of having to manually un-stage changes in these folders.

一旦它决定跟踪它们,我该如何让git停止跟踪CVS文件夹?

How do I make git stop tracking the CVS folders once it's decided to track them?

推荐答案

.gitignore 只会导致git忽略未跟踪的文件。 CVS已被追踪,因此您必须首先将其从存储库中删除:

.gitignore only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:

git rm -r --cached CVS

- cached 选项会导致git离开该文件的工作副本完好无损,而不是将其删除。完成后, .gitignore 中的条目将阻止git再次与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.

$ b $

Git将永远不会决定它是否可以让Git停止跟踪CVS文件夹?跟踪内容,它只是你告诉它的内容。在某些时候,您手动将其添加到索引,然后将其提交到存储库。

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-cvsimport后取消跟踪CVS文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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