defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder //显示隐藏文件 
 defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder //隐藏隐藏文件 
 早期的OS X(10.6~10.8)系统可以使用如下两条命令来开始或者关闭系统隐藏文件的显示:
defaults write com.apple.Finder AppleShowAllFiles Yes && killall Finder //显示隐藏文件
defaults write com.apple.Finder AppleShowAllFiles No && killall Finder //不显示隐藏文件
当升级到OS X 10.9 Mavericks版本之后,这两条命令需要做一些修改,变成了如下命令:
defaults write com.apple.finder AppleShowAllFiles Yes && killall Finder //显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles No && killall Finder //不显示隐藏文件
具体操作是:打开一个Finder 同时按住commamd+shift+G,输入~/.gitignore_global,然后前往,打开文件,将下面的文字复制粘贴进去保存即可
OS X
.DS_Store
Xcode
build/ 
 *.pbxuser 
 !default.pbxuser 
 *.mode1v3 
 !default.mode1v3 
 *.mode2v3 
 !default.mode2v3 
 *.perspectivev3 
 !default.perspectivev3 
 xcuserdata/ 
 *.xccheckout 
 profile 
 *.moved-aside 
 DerivedData 
 *.hmap 
 *.ipa
Bundler
.bundle 
 Carthage
We recommend against adding the Pods directory to your .gitignore. However
you should judge for yourself, the pros and cons are mentioned at:
http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
Note: if you ignore the Pods directory, make sure to uncomment
pod install in .travis.yml
#
Pods/
                










