1.找到git对应的文件
git status
结果 会得到已经修改的文件。
例如: modified: RunQuickly.xcworkspace/xcuserdata/lyj.xcuserdatad/UserInterfaceState.xcuserstate
2:删除缓存
git rm --cached 要隐藏的文件名
例如:git rm --cached RunQuickly.xcworkspace/xcuserdata/lyj.xcuserdatad/UserInterfaceState.xcuserstate
3:删除远程的文件
git commit -m 要隐藏的文件名
例如: git commit -m RunQuickly.xcworkspace/xcuserdata/lyj.xcuserdatad/UserInterfaceState.xcuserstate
可以看到删除成功
delete mode 100644 RunQuickly.xcworkspace/xcuserdata/lyj.xcuserdatad/UserInterfaceState.xcuserstate
4: 提交
git push
5:在sourcetree中右键忽略不需要的文件
网友评论