I am new to Git, and this is my first project using Git rather than SVN as my source control. I am working in XCode on an iPhone project. I want Git to ignore the build directory, which is in the root folder of the XCode project. I've found several other questions here and also found articles on google that provide examples on how to create the .gitignore file in the root directory and then add it to the Git repository to get the directory to be ignored.
Here are the steps I'm taking when setting up the repository:
- Open Terminal and navigate to the root directory of the application
- Call
git init
to initialize the repository - Call
git add .gitignore
to add the gitig开发者_如何学Gonore file - Call
git commit -m
to commit the gitignore file - Call
git status
to view the status of the repository
At this point, all of the other directories and files listed in my gitignore file are properly ignored except the build directory. Here is what my gitignore file looks like:
build/
.DS_Store
**/*.pbxuser
*.mode2v3
*.mode1v3
**/*.perspectivev*
I have tried ignoring the build directory using the following different entries with no success:
- build
- build/
- build/*
Anyone know what I'm doing wrong here?
build/
or build/*
should be enough to ignore the directory.
The only reasons it could be still not ignored at this point if it:
- has somehow been added to the index and committed (which, according to your setup, shouldn't be the case)
- has a trailing space in the .gitignore file rule (like this msysgit config)
精彩评论