使用版本控制来托管代码时会遇到这样的问题
1.添加过.gitignore文件
Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
Pods - for those of you who use CocoaPods
Pods
Podfile.lock
2.如每次push时还是会有UserInterfaceState.xcuserstate文件
这时可以在终端中输入:
git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
(1).ProjectFolder为对应的工程名称
(2).myUserName为对应的用户名称
例如:
git rm --cached Horrible_FM.xcodeproj/project.xcworkspace/xcuserdata/miniu.xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"