0

I am very new to Git and am trying to use a .gitignore file. I have an Xcode project which includes many CocoaPods and Nodejs modules. I want all these files to be ignored, but I'm not sure how to create a .gitignore file and how to specify which files to ignore. Somebody please help.

Nikhil Sridhar
  • 1,670
  • 5
  • 20
  • 39
  • Possible duplicate of [Git ignore file for Xcode projects](https://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects) – phd Apr 15 '18 at 22:47

1 Answers1

0

First, you can simply copy a .gitignore file from gitignore.io:

https://www.gitignore.io/api/xcode

Second, make sure those files were not already added to the index.
Do a git check-ignore -v -- a/file/I/want/ignored: if it returns nothing, then remove it from the index (git rm --cached a/file/I/want/ignored) and try again.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250