`
woainike
  • 浏览: 79622 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
最近访客 更多访客>>
社区版块
存档分类
最新评论

Xcode, git and .DS_Store

 
阅读更多

On trying to merge two git branches, I’ve often found Xcode 4 displays “Branches not found” in the Merge dialog, despite the Organiser clearly recognising multiple branches for the repo.

It seems the problem occurs because Xcode believes the working copy has uncommitted changes (even though the Commit dialog clearly shows there’s nothing to commit). The reason is that Xcode 4 doesn’t instruct git to ignore system invisible files, specifically .DS_Store (see rdar://8951416).

Turns out the workaround isn’t hard, just create a global excludes file:

git config --global core.excludesfile ~/.gitignore

… and ensure .DS_Store is ignored:

echo .DS_Store >> ~/.gitignore

Xcode will then allow you to merge branches or perform any other operation that was being prevented because it incorrectly thought there was something to commit.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics