Skip to main content

A better sample gitignore file for XCode Cocoa projects on Mac OS X (iPhone, too)

When we switched to git last year (from Subversion) we took a little time and beefed up our ignore file. While working on another project recently, I realized that most of the example .gitignore files for Cocoa/MacOSX/XCode on the web are really not terribly complete, and the results can be very frustrating when you're just getting started with a new repository.

Here's a better .gitignore example. Let me know if I left anything out. (I saw a few examples from people who exclude the pattern "profile", but as far as I can tell, that's really not a very good idea. I assume they have a specific use case of some kind which eludes my pondering.)

The current version of this file can be found on GitHub:
.gitignore for Xcode, Cocoa, Swift, Objective C, Mac OS X, iOS, TV, Watch

A better .gitignore for XCode, Cocoa, and Mac OS X git repositories:

# Mac OS X Finder and whatnot
.DS_Store

# Sparkle distribution Private Key (Don't check me in!)
dsa_priv.pem

# XCode (and ancestors) per-user config (very noisy, and not relevant)
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser

# Generated files
VersionX-revision.h

# build products
build/
*.[oa]

# Other source repository archive directories (protects when importing) .hg .svn CVS # automatic backup files *~.nib *.swp *~ *(Autosaved).rtfd/ Backup[ ]of[ ]*.pages/ Backup[ ]of[ ]*.key/ Backup[ ]of[ ]*.numbers/

Comments

  1. hey I borrowed your better code - and I added to it - heres a script that puts this and something for .gitattributes into an Xcode script menu item - to auto generate it for the directory of your choosing.

    http://github.com/tbarbe/Xcode-Git-User-Script

    Thanks for posting your stuff - hopefully my mod is useful to someone.

    ReplyDelete
  2. We've created a GitHub repository and added the (much expanded) .gitignore file that we currently use. Share and enjoy!

    A Better .gitignore for Cocoa and Xcode

    ReplyDelete

Post a Comment

Popular posts from this blog

Blogs: Not dead, yet!

If you're a blogger, you might find this essay, recently shared to YCombinator's Hacker News  from a blog, to be of interest. It's perhaps a little pessimistic, but has some fair observations about the state of affairs in the #blogosphere.  If I could bring one thing back to the internet it would be blogs It's almost impossible now to find a blog that's not on a focused theme because that's what search engines focus on and how websites profit. But you want the opposite, a blog that never tried to focus or even thought about it.  The observations about the role of the only search engine that presently matters, Google, in the state of the blogosphere are worthy of consideration. In the discussion at Hacker News, the author was criticized a bit for saying that Google Blogger was "dead" —which itself seems a pretty fair criticism if not strictly accurate in a pedantic sense. Google basically abandoned Blogger in place years ago. Sure, our own ill

Black Monday was the Big Bang

On February 11, 1993 NeXT announced they would no longer make and sell their sleek black computers the NeXTcube and related family of "pizza box" workstations known as NeXTstation . Three hundred people were fired and the company reformed around a software strategy based on pitching their operating system and object-oriented software developer tools known collectively as NeXTSTEP, for various  hardware platforms including PA-RISC, SPARC, and Intel x86.  In addition to providing their OS on other hardware platforms, the company worked with partners including Sun and Microsoft to layer their developer tools on other platforms including OpenStep for Solaris and OpenStep for Windows (sometimes known as "Yellow Box"). Known by the community of NeXT enthusiasts wryly as "Black Monday" this transition led to some amusing footnotes in the history of computing. One Wall Street firm, AIG Trading, didn't pick up the advanced (but probably very subtle) hints

ectoize - bookmarklet for ecto

We received an interesting email from an ecto customer recently. Here's what they asked us about: "Hello, Any text that I publish using the "ectoize" bookmarklet appears on my blog entirely in italics, indented, with a vertical line on the left side of the text. I've searched high-and-low but can't find any reference to this problem on your website or in the documentation. Can you help? Thanks." Of course, since we didn't have the full context, we had to chat back and forth a bit to figure out what they were really trying to do. They had been advised by a WordPress consultant to use ectoize, the ecto bookmarklet, as a tool to help them migrate content from a static web site (which had been created in GoLive) to a new site, managed in WordPress. ectoize, the bookmarklet, grabs a chunk of highlighted text from a web browser window, launches ecto, and pastes the text into a nice little block quote. The italics and vertical line were coming from th