Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因此,一个配置文件以某种方式进入了我们不想要的 git 存储库。但我们确实希望在我们的个人系统上使用它。
当我们的团队成员进行拉取时,有没有办法将文件从存储库中取出,而不会导致文件从单个存储库中删除?
非常感谢!
您需要使用从存储库(不是工作树)中删除它
git rm --cached
并告诉您的同事在他们第一次同步(拉取)他们的存储库时进行备份,因为 git 会删除它。 否则,即使文件存在于.gitignore,当文件作为存储库的一部分时,git 总是会检测到更改。
.gitignore