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.