开发者

Git Ignore Pattern for XCode Build Directory

开发者 https://www.devze.com 2023-01-08 04:22 出处:网络
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

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:

  1. Open Terminal and navigate to the root directory of the application
  2. Call git init to initialize the repository
  3. Call git add .gitignore to add the gitig开发者_如何学Gonore file
  4. Call git commit -m to commit the gitignore file
  5. 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)
0

精彩评论

暂无评论...
验证码 换一张
取 消