.gitignore文件,我应该把它放在我的xcode项目中? [英] .gitignore file, where should I put it in my xcode project?
问题描述
我想让git在我的XCode4项目中忽略我的 UserInterfaceState.xcuserstate
文件,但是我应该在哪里放置 .gitignore
文件?,它在 .git
文件夹中吗?或出去? .git
与 ProjectName.xcodeproj
文件位于同一个文件夹中
您可以在项目的每个目录中都有 .gitignore
。 然而,最好的做法是在项目根目录下有一个 .gitignore
文件,并将所有文件文件,你想忽略它,像这样:
ignoredFile.whatever
ignoredDirectory / *
目录/ ignoredFileInsideDirectory
.svn
创建 .gitignore
文件中,忽略文件有变化或者是新的版本库不会显示为等待提交。
您也可以拥有一个全局的本地git忽略文件,它将管理你所有的git仓库。
$ b $ g $ git config --global core.excludesfile〜/ .gitignore_global
对于与项目无关的忽略文件,如IDE相关文件等,这种替代方法特别有趣。 b $ b
I want git to ignore my UserInterfaceState.xcuserstate
file in my XCode4 project, but where should I put the .gitignore
file?, is it inside the .git
folder? or out? The .git
is in same folder with the ProjectName.xcodeproj
file
You can have a .gitignore
in every single directory of your project.
However, the best practice is to have one single .gitignore
file on the project root directory, and place all files that you want to ignore in it, like this:
ignoredFile.whatever
ignoredDirectory/*
directory/ignoredFileInsideDirectory
.svn
Once you create the .gitignore
file, the ignore files that have changes or are new into the repository will not be shown to as waiting for commit.
You can also have one global local git ignore file, that will manage all of your git repositories.
git config --global core.excludesfile ~/.gitignore_global
This alternative is particularly interesting for ignored files that are non-project related, such as IDE related files and so on.
这篇关于.gitignore文件,我应该把它放在我的xcode项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!