切换到git控制的程序目录 从别处拷贝 或者自己创建一个.gitignore 内容如下
Xcode
/Demo/Demo-Info.plist
.DS_Store
/build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
CocoaPods
Pods
保存之后,你会发现这个文件并未生效原因是因为.ignore是后来加进来的 local cache里面记录的这个文件是不忽略的 所以需要进行缓存清除
$ git rm --cached iLedger.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate $ git commit -m "Removed the stupid strange file that shouldn't be tracked" $ git push
本文详细介绍了如何解决在使用Git进行版本控制时遇到的.gitignore文件未生效的问题,包括了缓存清理、文件忽略状态检查及正确配置步骤。
272

被折叠的 条评论
为什么被折叠?



