将git .gitignore规则应用于现有的存储库 [英] Apply git .gitignore rules to an existing repository

查看:112
本文介绍了将git .gitignore规则应用于现有的存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在一个xcode项目中使用git,并且最近发现我可以使用.gitignore和.gitattributes文件来忽略来自编译器和系统的噪音。 现在我已经创建了.gitignore和.gitattributes文件,我该如何应用新的忽略规则并摆脱版本控制的压力?

I started using git with an xcode project and have recently discovered that I can use .gitignore and .gitattributes files to ignore the noise from the compiler and system. Now that I have the .gitignore and .gitattributes files in place, how can I "apply" the new ignore rules and get rid of the crud from version control?

我的.gitignore文件是:

My .gitignore file is:

# xcode noise
*.modelv3
*.pbxuser
*.perspective
*.perspectivev3
*.pyc
*~.nib/
build/*

# Textmate - if you build your xcode projects with it
*.tm_build_errors

# old skool
.svn

# osx noise
.DS_Store
profile

我的.gitattributes文件是:

And my .gitattributes file is:

*.pbxproj -crlf -diff -merge

感谢!

推荐答案

使用 git rm --cached 文件和 git rm -r --cached 用于 build / 目录

这篇关于将git .gitignore规则应用于现有的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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