tit*_*aca 22 git xcode commit github xcode4.5
我不能从提交中排除用户界面状态文件.
每次我试图推送到github时它都会要求我先提交并将用户界面状态文件插入到更改中(即使我没有移动鼠标或界面,它仍然显示提交!).
我尝试了其他类似主题中描述的不同方法.例如,我尝试将所有可能的用户界面案例添加到root中的.gitignore中,如下所示:
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
Run Code Online (Sandbox Code Playgroud)
它没用.我试图清理缓存并重置git,没有帮助.
Git status命令说明如下:"modified:.xcodeproj/project.xcworkspace/xcuserdata/.xcuserdatad/UserInterfaceState.xcuserstate"
它看起来像这样
请帮忙(这让我发疯了)!
Von*_*onC 33
如果这些文件已提交,则需要在查看.gitignore文件之前将其从索引中删除.
git rm --cached *.xcuserstate
# or
git rm -r --cached project.xcworkspace
Run Code Online (Sandbox Code Playgroud)
Stu*_* P. 19
要调用-rm你还必须承诺,然后推(在终端执行此操作之前接触的Xcode或它再次混帐工具)后,添加到VonC的答案,这解决了我的问题.
所以
git rm --cached *.xcuserstate
git commit -m "Removed cached files"
git push
Run Code Online (Sandbox Code Playgroud)
然后你可以再次触摸Xcode