<p>Which files should I include in <code>.gitignore</code> when using <em>Git</em> in conjunction with <em>Xcode</em>?</p>

[{'answer_id': 49488, 'author': 'Hagelin', 'author_id': 5156, 'author_profile': 'https://Stackoverflow.com/users/5156', 'pm_score': 8, 'selected': False, 'text': '<p>Based on <a href="http://boredzo.org/blog/archives/2008-03-20/hgignore-for-mac-os-x-applications" rel="noreferrer" title=".hgignore for Mac OS X applications">this guide for Mercurial</a> my .gitignore includes:</p>\n\n<pre><code>.DS_Store\n*.swp\n*~.nib\n\nbuild/\n\n*.pbxuser\n*.perspective\n*.perspectivev3\n</code></pre>\n\n<p>I\'ve also chosen to include:</p>\n\n<pre><code>*.mode1v3\n*.mode2v3\n</code></pre>\n\n<p>which, according to <a href="http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00465.html" rel="noreferrer" title="Re: What are *.mode1v3 and *.mode2v3 files?">this Apple mailing list post</a>, are "user-specific project settings". </p>\n\n<p>And for Xcode 4:</p>\n\n<pre><code>xcuserdata\n</code></pre>\n'}, {'answer_id': 50283, 'author': 'Dave Verwer', 'author_id': 4496, 'author_profile': 'https://Stackoverflow.com/users/4496', 'pm_score': 3, 'selected': False, 'text': '<p>Mine is a .bzrignore, but it is the same idea :)</p>\n\n<pre><code>.DS_Store\n*.mode1v3\n*.pbxuser\n*.perspectivev3\n*.tm_build_errors\n</code></pre>\n\n<p>The tm_build_errors is for when I use <a href="http://en.wikipedia.org/wiki/TextMate" rel="nofollow noreferrer">TextMate</a> to build my project. It is not quite as comprehensive as Hagelin, but I thought it was worth posting for the tm_build_errors line.</p>\n'}, {'answer_id': 349129, 'author': 'Abizern', 'author_id': 41116, 'author_profile': 'https://Stackoverflow.com/users/41116', 'pm_score': 6, 'selected': False, 'text': '<p>Regarding the \'build\' directory exclusion - </p>\n\n<p>If you place your build files in a different directory from your source, as I do, you don\'t have the folder in the tree to worry about.</p>\n\n<p>This also makes life simpler for sharing your code, preventing bloated backups, and even when you have dependencies to other Xcode projects (while require the builds to be in the same directory as each other)</p>\n\n<p>You can grab an up-to-date copy from the Github gist <a href="https://gist.github.com/708713" rel="noreferrer">https://gist.github.com/708713</a></p>\n\n<p>My current .gitignore file is</p>\n\n<pre><code># Mac OS X\n*.DS_Store\n\n# Xcode\n*.pbxuser\n*.mode1v3\n*.mode2v3\n*.perspectivev3\n*.xcuserstate\nproject.xcworkspace/\nxcuserdata/\n\n# Generated files\n*.o\n*.pyc\n\n\n#Python modules\nMANIFEST\ndist/\nbuild/\n\n# Backup files\n*~.nib\n</code></pre>\n'}, {'answer_id': 3924579, 'author': 'Vladimir Mitrovic', 'author_id': 281119, 'author_profile': 'https://Stackoverflow.com/users/281119', 'pm_score': 6, 'selected': False, 'text': '<p>For Xcode 4 I also add:</p>\n\n<pre><code>YourProjectName.xcodeproj/xcuserdata/*\nYourProjectName.xcodeproj/project.xcworkspace/xcuserdata/*\n</code></pre>\n'}, {'answer_id': 11811069, 'author': 'Eric', 'author_id': 1072846, 'author_profile': 'https://Stackoverflow.com/users/1072846', 'pm_score': 4, 'selected': False, 'text': '<p>The people of GitHub have exhaustive and documented .gitignore files for Xcode projects:</p>\n\n<p><strong>Swift:</strong> <a href="https://github.com/github/gitignore/blob/master/Swift.gitignore" rel="noreferrer">https://github.com/github/gitignore/blob/master/Swift.gitignore</a></p>\n\n<p><strong>Objective-C:</strong> <a href="https://github.com/github/gitignore/blob/master/Objective-C.gitignore" rel="noreferrer">https://github.com/github/gitignore/blob/master/Objective-C.gitignore</a></p>\n'}, {'answer_id': 12021580, 'author': 'Adam', 'author_id': 153422, 'author_profile': 'https://Stackoverflow.com/users/153422', 'pm_score': 10, 'selected': True, 'text': '\n\n<p>I was previously using the top-voted answer, but it needs a bit of cleanup, so here it is redone for Xcode 4, with some improvements.</p>\n\n<p>I\'ve researched <em>every</em> file in this list, but several of them do not exist in Apple\'s official Xcode documentation, so I had to go on Apple mailing lists.</p>\n\n<p>Apple continues to add undocumented files, potentially corrupting our live projects. This IMHO is unacceptable, and I\'ve now started logging bugs against it each time they do so. I know they don\'t care, but maybe it\'ll shame one of them into treating developers more fairly.</p>\n\n<hr>\n\n<p>If you need to customize, here\'s a gist you can fork: <a href="https://gist.github.com/3786883" rel="noreferrer">https://gist.github.com/3786883</a></p>\n\n<hr>\n\n<pre><code>#########################\n# .gitignore file for Xcode4 and Xcode5 Source projects\n#\n# Apple bugs, waiting for Apple to fix/respond:\n#\n#    15564624 - what does the xccheckout file in Xcode5 do? Where\'s the documentation?\n#\n# Version 2.6\n# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects\n#\n# 2015 updates:\n# - Fixed typo in "xccheckout" line - thanks to @lyck for pointing it out!\n# - Fixed the .idea optional ignore. Thanks to @hashier for pointing this out\n# - Finally added "xccheckout" to the ignore. Apple still refuses to answer support requests about this, but in practice it seems you should ignore it.\n# - minor tweaks from Jona and Coeur (slightly more precise xc* filtering/names)\n# 2014 updates:\n# - appended non-standard items DISABLED by default (uncomment if you use those tools)\n# - removed the edit that an SO.com moderator made without bothering to ask me\n# - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker\n# 2013 updates:\n# - fixed the broken "save personal Schemes"\n# - added line-by-line explanations for EVERYTHING (some were missing)\n#\n# NB: if you are storing "built" products, this WILL NOT WORK,\n# and you should use a different .gitignore (or none at all)\n# This file is for SOURCE projects, where there are many extra\n# files that we want to exclude\n#\n#########################\n\n#####\n# OS X temporary files that should never be committed\n#\n# c.f. http://www.westwind.com/reference/os-x/invisibles.html\n\n.DS_Store\n\n# c.f. http://www.westwind.com/reference/os-x/invisibles.html\n\n.Trashes\n\n# c.f. http://www.westwind.com/reference/os-x/invisibles.html\n\n*.swp\n\n#\n# *.lock - this is used and abused by many editors for many different things.\n#    For the main ones I use (e.g. Eclipse), it should be excluded\n#    from source-control, but YMMV.\n#   (lock files are usually local-only file-synchronization on the local FS that should NOT go in git)\n# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations!\n#\n# In particular, if you\'re using CocoaPods, you\'ll want to comment-out this line:\n*.lock\n\n\n#\n# profile - REMOVED temporarily (on double-checking, I can\'t find it in OS X docs?)\n#profile\n\n\n####\n# Xcode temporary files that should never be committed\n# \n# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...\n\n*~.nib\n\n\n####\n# Xcode build files -\n#\n# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"\n\nDerivedData/\n\n# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"\n\nbuild/\n\n\n#####\n# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)\n#\n# This is complicated:\n#\n# SOMETIMES you need to put this file in version control.\n# Apple designed it poorly - if you use "custom executables", they are\n#  saved in this file.\n# 99% of projects do NOT use those, so they do NOT want to version control this file.\n#  ..but if you\'re in the 1%, comment out the line "*.pbxuser"\n\n# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html\n\n*.pbxuser\n\n# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html\n\n*.mode1v3\n\n# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html\n\n*.mode2v3\n\n# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file\n\n*.perspectivev3\n\n#    NB: also, whitelist the default ones, some projects need to use these\n!default.pbxuser\n!default.mode1v3\n!default.mode2v3\n!default.perspectivev3\n\n\n####\n# Xcode 4 - semi-personal settings\n#\n# Apple Shared data that Apple put in the wrong folder\n# c.f. http://stackoverflow.com/a/19260712/153422\n#     FROM ANSWER: Apple says "don\'t ignore it"\n#     FROM COMMENTS: Apple is wrong; Apple code is too buggy to trust; there are no known negative side-effects to ignoring Apple\'s unofficial advice and instead doing the thing that actively fixes bugs in Xcode\n# Up to you, but ... current advice: ignore it.\n*.xccheckout\n\n#\n#\n# OPTION 1: ---------------------------------\n#     throw away ALL personal settings (including custom schemes!\n#     - unless they are "shared")\n# As per build/ and DerivedData/, this ought to have a trailing slash\n#\n# NB: this is exclusive with OPTION 2 below\nxcuserdata/\n\n# OPTION 2: ---------------------------------\n#     get rid of ALL personal settings, but KEEP SOME OF THEM\n#     - NB: you must manually uncomment the bits you want to keep\n#\n# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,\n#    or manually install git over the top of the OS X version\n# NB: this is exclusive with OPTION 1 above\n#\n#xcuserdata/**/*\n\n#     (requires option 2 above): Personal Schemes\n#\n#!xcuserdata/**/xcschemes/*\n\n####\n# Xcode 4 workspaces - more detailed\n#\n# Workspaces are important! They are a core feature of Xcode - don\'t exclude them :)\n#\n# Workspace layout is quite spammy. For reference:\n#\n# /(root)/\n#   /(project-name).xcodeproj/\n#     project.pbxproj\n#     /project.xcworkspace/\n#       contents.xcworkspacedata\n#       /xcuserdata/\n#         /(your name)/xcuserdatad/\n#           UserInterfaceState.xcuserstate\n#     /xcshareddata/\n#       /xcschemes/\n#         (shared scheme name).xcscheme\n#     /xcuserdata/\n#       /(your name)/xcuserdatad/\n#         (private scheme).xcscheme\n#         xcschememanagement.plist\n#\n#\n\n####\n# Xcode 4 - Deprecated classes\n#\n# Allegedly, if you manually "deprecate" your classes, they get moved here.\n#\n# We\'re using source-control, so this is a "feature" that we do not want!\n\n*.moved-aside\n\n####\n# OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development\n#\n# NB: I\'d rather not include these here, but gitignore\'s design is weak and doesn\'t allow\n#     modular gitignore: you have to put EVERYTHING in one file.\n#\n# COCOAPODS:\n#\n# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock\n# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control\n#\n#!Podfile.lock\n#\n# RUBY:\n#\n# c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/\n#\n#!Gemfile.lock\n#\n# IDEA:\n#\n# c.f. https://www.jetbrains.com/objc/help/managing-projects-under-version-control.html?search=workspace.xml\n# \n#.idea/workspace.xml\n#\n# TEXTMATE:\n#\n# -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422\n#\n#tm_build_errors\n\n####\n# UNKNOWN: recommended by others, but I can\'t discover what these files are\n#\n</code></pre>\n'}, {'answer_id': 12591443, 'author': 'user1524957', 'author_id': 1524957, 'author_profile': 'https://Stackoverflow.com/users/1524957', 'pm_score': 2, 'selected': False, 'text': "<p>I've added:</p>\n\n<pre><code>xcuserstate\nxcsettings\n</code></pre>\n\n<p>and placed my .gitignore file at the root of my project.</p>\n\n<p>After committing and pushing.  I then ran:</p>\n\n<pre><code>git rm --cached UserInterfaceState.xcuserstate WorkspaceSettings.xcsettings\n</code></pre>\n\n<p>buried with the folder below:</p>\n\n<pre><code>&lt;my_project_name&gt;/&lt;my_project_name&gt;.xcodeproj/project.xcworkspace/xcuserdata/&lt;my_user_name&gt;.xcuserdatad/\n</code></pre>\n\n<p>I then ran git commit and push again</p>\n"}, {'answer_id': 16062099, 'author': 'Wanbok Choi', 'author_id': 1602311, 'author_profile': 'https://Stackoverflow.com/users/1602311', 'pm_score': 4, 'selected': False, 'text': "<p>I'm using both AppCode and XCode.\nSo <code>.idea/</code> should be ignored.</p>\n\n<p>append this to Adam's <code>.gitignore</code></p>\n\n<pre><code>####\n# AppCode\n.idea/\n</code></pre>\n"}, {'answer_id': 18608481, 'author': 'Basil Abbas', 'author_id': 1103128, 'author_profile': 'https://Stackoverflow.com/users/1103128', 'pm_score': 0, 'selected': False, 'text': '<p>We did find that even if you add the .gitignore and the .gitattribte the *.pbxproj file can get corrupted. So we have a simple plan.</p>\n\n<p>Every person that codes in office simply discards the changes made to this file. In the commit we simple mention the files that are added into the source. And then push to the server. Our integration manager than pulls and sees the commit details and adds the files into the resources.</p>\n\n<p>Once he updates the remote everyone will always have a working copy. In case something is missing then we inform him to add it in and then pull once again.</p>\n\n<p>This has worked out for us without any issues. </p>\n'}, {'answer_id': 19397066, 'author': 'Wanbok Choi', 'author_id': 1602311, 'author_profile': 'https://Stackoverflow.com/users/1602311', 'pm_score': 3, 'selected': False, 'text': '<p>For Xcode 5 I add:</p>\n\n<pre><code>####\n# Xcode 5 - VCS metadata\n#\n*.xccheckout\n</code></pre>\n\n<p>From <a href="https://stackoverflow.com/a/18448100/1602311">Berik\'s Answer</a></p>\n'}, {'answer_id': 26034755, 'author': 'onmyway133', 'author_id': 1418457, 'author_profile': 'https://Stackoverflow.com/users/1418457', 'pm_score': 4, 'selected': False, 'text': '<p>You should checkout <a href="https://www.gitignore.io/" rel="nofollow noreferrer">gitignore.io</a> for Objective-C and Swift.</p>\n\n<p>Here is the <code>.gitignore</code> file I\'m using:</p>\n\n<pre><code># Xcode\n.DS_Store\n*/build/*\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\nprofile\n*.moved-aside\nDerivedData\n.idea/\n*.hmap\n*.xccheckout\n*.xcworkspace\n!default.xcworkspace\n\n#CocoaPods\nPods\n</code></pre>\n'}, {'answer_id': 26615020, 'author': 'funroll', 'author_id': 878969, 'author_profile': 'https://Stackoverflow.com/users/878969', 'pm_score': 2, 'selected': False, 'text': '<p>Here\'s the <code>.gitignore</code> that GitHub uses by default for new Xcode repositories:</p>\n\n<p><a href="https://github.com/github/gitignore/blob/master/Objective-C.gitignore" rel="nofollow">https://github.com/github/gitignore/blob/master/Objective-C.gitignore</a></p>\n\n<p>It\'s likely to be reasonably correct at any given time.</p>\n'}, {'answer_id': 31962296, 'author': 'joserock85', 'author_id': 2315658, 'author_profile': 'https://Stackoverflow.com/users/2315658', 'pm_score': 2, 'selected': False, 'text': '<p>I use the following .gitignore file generated in gitignore.io:</p>\n\n<pre><code>### Xcode ###\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.xcuserstate\n\n\n### Objective-C ###\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control\n#\nPods/\n</code></pre>\n'}, {'answer_id': 33688681, 'author': 'swiftBoy', 'author_id': 1371853, 'author_profile': 'https://Stackoverflow.com/users/1371853', 'pm_score': 4, 'selected': False, 'text': '<p>Adding a <strong>.gitignore file</strong> for</p>\n\n<blockquote>\n  <p><strong>Mac OS X</strong> + <strong>Xcode</strong>  + <strong>Swift</strong></p>\n</blockquote>\n\n<p>This is how I have added a .gitignore file into my Swift project:</p>\n\n<ol>\n<li>Select you project in Xcode and right click &rarr; <em>New Group</em> &rarr; name it "<strong>Git</strong>"</li>\n<li>Select the Git folder and right click &rarr; <em>Add new file</em></li>\n<li>Within the <em>iOS tab</em> &rarr; select <em>Other</em> &rarr; <em>empty file</em></li>\n</ol>\n\n<p><a href="https://i.stack.imgur.com/vNPOE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vNPOE.png" alt="Enter image description here"></a></p>\n\n<ol start="3">\n<li>Give the file name here "<strong>.gitignore</strong>"</li>\n</ol>\n\n<p><a href="https://i.stack.imgur.com/PXQ4k.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PXQ4k.png" alt="Enter image description here"></a></p>\n\n<ol start="4">\n<li>Confirm the file name and type</li>\n</ol>\n\n<p><a href="https://i.stack.imgur.com/lpi25.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lpi25.png" alt="Enter image description here"></a></p>\n\n<p>Here is the result structure:</p>\n\n<p><a href="https://i.stack.imgur.com/Zof1f.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Zof1f.png" alt="Enter image description here"></a></p>\n\n<ol start="5">\n<li>Open the file and past the below code</li>\n</ol>\n\n<hr>\n\n<pre><code># file\n\n#########################################################################\n#                                                                       #\n#       Title         - .gitignore file                                 #\n#       For           - Mac OS X, Xcode 7 and Swift Source projects     #\n#       Updated by    - Ramdhan Choudhary                               #\n#       Updated on    - 13 - November - 2015                            #\n#                                                                       #\n#########################################################################\n\n########### Xcode ###########\n# Xcode temporary files that should never be committed\n\n## Build generated\nbuild/\nDerivedData\n\n# NB: NIB/XIB files still exist even on Storyboard projects, so we want this\n*~.nib\n*.swp\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n\n## Other\n*.xccheckout\n*.moved-aside\n*.xcuserstate\n*.xcscmblueprint\n*.xcscheme\n\n########### Mac OS X ###########\n# Mac OS X temporary files that should never be committed\n\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon must end with two \\r\nIcon\n\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n########## Objective-C/Swift specific ##########\n*.hmap\n*.ipa\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the Git repository. Instead, use fastlane to re-generate the\n\nfastlane/report.xml\nfastlane/screenshots\n</code></pre>\n\n<hr>\n\n<p>Well, <a href="https://stackoverflow.com/users/153422/adam">thanks to Adam</a>. His answer helped me a lot, but still I had to add a few more entries as I wanted a .gitignore file for:</p>\n\n<p>Mac OS X + Xcode + Swift</p>\n\n<p>References: <a href="https://www.gitignore.io/api/xcode,osx,swift" rel="noreferrer">this</a> and <a href="https://github.com/github/gitignore/blob/master/Swift.gitignore" rel="noreferrer">this</a></p>\n'}, {'answer_id': 42062650, 'author': 'alicanbatur', 'author_id': 1084631, 'author_profile': 'https://Stackoverflow.com/users/1084631', 'pm_score': 3, 'selected': False, 'text': '<p>Best of all, </p>\n\n<blockquote>\n  <p><a href="http://gitignore.io" rel="nofollow noreferrer">gitignore.io</a></p>\n</blockquote>\n\n<p>Go and choose your language, and then it\'ll give you the file.</p>\n'}, {'answer_id': 48268216, 'author': 'damianesteban', 'author_id': 2945764, 'author_profile': 'https://Stackoverflow.com/users/2945764', 'pm_score': 0, 'selected': False, 'text': '<p>I recommend using <a href="https://github.com/karan/joe" rel="nofollow noreferrer">joe</a> to generate a <code>.gitignore</code> file.</p>\n\n<p>For an iOS project run the following command:</p>\n\n<p><code>$ joe g osx,xcode &gt; .gitignore</code></p>\n\n<p>It will generate this <code>.gitignore</code>:</p>\n\n<pre><code>.DS_Store\n.AppleDouble\n.LSOverride\n\nIcon\n._*\n\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\nbuild/\nDerivedData\n\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n\n*.xccheckout\n*.moved-aside\n*.xcuserstate\n</code></pre>\n'}, {'answer_id': 51133984, 'author': 'Rahul Singha Roy', 'author_id': 9557153, 'author_profile': 'https://Stackoverflow.com/users/9557153', 'pm_score': -1, 'selected': False, 'text': '<blockquote>\n  <p><em>A Structure of a standerd .gitignore file for Xcode project ></em></p>\n</blockquote>\n\n<pre><code>.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nIcon?\nehthumbs.db\nThumbs.db\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\n!default.xcworkspace\nxcuserdata\nprofile\n*.moved-aside\nDerivedData\n.idea/\n</code></pre>\n'}, {'answer_id': 53515016, 'author': 'BB9z', 'author_id': 945906, 'author_profile': 'https://Stackoverflow.com/users/945906', 'pm_score': 3, 'selected': False, 'text': '<p>Most of the answers are from the Xcode 4-5 era. I recommend an ignore file in a modern style.</p>\n<pre><code># Xcode Project\n**/*.xcodeproj/xcuserdata/\n**/*.xcworkspace/xcuserdata/\n**/.swiftpm/xcode/xcuserdata/\n**/*.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist\n**/*.xcworkspace/xcshareddata/*.xccheckout\n**/*.xcworkspace/xcshareddata/*.xcscmblueprint\n**/*.playground/**/timeline.xctimeline\n.idea/\n\n# Build\nScripts/build/\nbuild/\nDerivedData/\n*.ipa\n\n# Carthage\nCarthage/\n\n# CocoaPods\nPods/\n\n# fastlane\nfastlane/report.xml\nfastlane/Preview.html\nfastlane/screenshots\nfastlane/test_output\nfastlane/sign&amp;cert\n\n# CSV\n*.orig\n.svn\n\n# Other\n*~\n.DS_Store\n*.swp\n*.save\n._*\n*.bak\n</code></pre>\n<p>Keep it updated from: <a href="https://github.com/BB9z/iOS-Project-Template/blob/master/.gitignore" rel="noreferrer">https://github.com/BB9z/iOS-Project-Template/blob/master/.gitignore</a></p>\n'}, {'answer_id': 65613459, 'author': 'jqgsninimo', 'author_id': 1260976, 'author_profile': 'https://Stackoverflow.com/users/1260976', 'pm_score': 2, 'selected': False, 'text': '<p><a href="https://www.gitignore.io" rel="nofollow noreferrer"><strong>gitignore.io</strong></a>: Create useful .gitignore files for your project</p>\n<ul>\n<li>Example (<code>macOS</code> <code>Objective-C</code> <code>Swift</code> <code>SwiftPackageManager</code> <code>Carthage</code>)\n<ul>\n<li><a href="https://www.toptal.com/developers/gitignore/api/swift,macos,carthage,objective-c,swiftpackagemanager" rel="nofollow noreferrer">Preview</a></li>\n<li><a href="https://www.toptal.com/developers/gitignore?templates=swift,macos,carthage,objective-c,swiftpackagemanager" rel="nofollow noreferrer">Edit</a></li>\n</ul>\n</li>\n<li>Steps to use in Terminal （Refer to <a href="https://youtu.be/UPkBC48NHnQ" rel="nofollow noreferrer">the YouTube Video</a>）\n<ol>\n<li><p>Create Git global config alias (One time only)</p>\n<pre><code>git config --global alias.ignore \'!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi\'\n</code></pre>\n</li>\n<li><p>Enter the project directory</p>\n<pre><code>cd &lt;the project directory&gt;\n</code></pre>\n</li>\n<li><p>Generate .gitignore file</p>\n<pre><code>git ignore macOS,Objective-C,Swift,SwiftPackageManager,Carthage &gt;.gitignore\n</code></pre>\n</li>\n<li><p>Add and commit .gitignore file</p>\n<pre><code>git add .gitignore\ngit commit -m &quot;Add .gitignore file&quot;\n</code></pre>\n</li>\n</ol>\n</li>\n</ul>\n'}, {'answer_id': 70019630, 'author': 'Alwin Jose', 'author_id': 11844048, 'author_profile': 'https://Stackoverflow.com/users/11844048', 'pm_score': 0, 'selected': False, 'text': '<p>If someone need a standard gitignore file as a simple way.</p>\n<p>Just run this line in cmd/ terminal after navigating to your project.</p>\n<pre><code>npx gitignore Objective-C\n</code></pre>\n'}, {'answer_id': 74349469, 'author': 'Ozgur Sahin', 'author_id': 4156490, 'author_profile': 'https://Stackoverflow.com/users/4156490', 'pm_score': 0, 'selected': False, 'text': '<p>This will create up-to-date gitignore file</p>\n<p>For iOS development</p>\n<pre><code>git ignore swift,ios &gt;.gitignore\n</code></pre>\n<p>For macOS development</p>\n<pre><code>git ignore swift,macos &gt;.gitignore\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/49478', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5156/']