转自:http://blog.csdn.net/jason_chen13/article/details/50751853
1.显示隐藏文件
显示:defaults write com.apple.finder AppleShowAllFiles YES
隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles NO
2.命令行 cd到项目根目录下
文稿 (Documents)
3.删除.DS_Store
find . -name .DS_Store -print0 | xargs -0 Git rm -f --ignore-unmatch
4.用命令行创建和打开
touch .gitignore
open .gitignore
5.输入要过虑文件
.DS_Store
DerivedData
.*.sw?
*.cso
tmp
*.mode1v3
*.pbxuser
*.xcworkspace
xcuserdata
console.log
(Git ignore UserInterfaceState.xcuserstate)
1. 退出xcdoe, 打开终端(Terminal),进入到你的项目目录下
2. 在终端键入
git rm --cached 工程名.xcodeproj/project.xcworkspace/xcuserdata/用户名.xcuserdatad/UserInterfaceState.xcuserstate
3. 在终端键入 git commit -m "Removed file that shouldn't be tracked"
4. 在.gitignore文件中加入如下几行
- *.xcuserstate
- project.xcworkspace
- xcuserdata
- UserInterfaceState.xcuserstate
- project.xcworkspace/
- xcuserdata/
- UserInterface.xcuserstate
5. 重新打开Xcode commit, push。