0

I am still pretty new to using git, and I am a little confused on how to ignore files. I know you make a file named .gitignore, and usually have it at the root directory of your project, but is that it?

Am I supposed to add it to my Xcode project in Xcode 5? Most of my research has shown what should be IN the .gitignore (like Gitignore/Objective-C.gitignore), but the closest I've found to my question is: How to add .gitignore file into Xcode project.

While that does say HOW to do it, is this what one does? Or do you just leave it in the base folder and it doesn't matter whether it is in the project or not?

Community
  • 1
  • 1
NickH
  • 683
  • 1
  • 5
  • 24

1 Answers1

1

.gitignore files are processed regardless of whether or not they're tracked. They're usually tracked, just as the main branch is usually called master, and since if they're not tracked they're vulnerable to e.g. git clean I can't figure why anyone would leave them untracked, but it's irrelevant. Only what's in them matters.

jthill
  • 55,082
  • 5
  • 77
  • 137
  • So, does that mean it is added into the Xcode 5 project file? Is that the only way to have it be tracked in the git repository via Xcode's version control interface? – NickH Apr 19 '14 at 23:58
  • 1
    Don't know about only, but why wouldn't you? I don't understand the concern about whether git or Xcode is tracking them. – jthill Apr 20 '14 at 00:01
  • It's not that I don't want Xcode to track it, it's more that I just don't know how others do it, and I have not seen it explicitly written anywhere. So it is a standard practice to have your .gitignore in your Xcode project? – NickH Apr 20 '14 at 00:04