git每次提交时忽略UserInterfaceState.xcuserstate文件变动

要在Git中忽略UserInterfaceState.xcuserstate文件的变动,你可以在仓库的根目录下创建或编辑一个.gitignore文件,并添加以下内容来忽略这类文件的跟踪:
*.xcuserstate
这会忽略所有扩展名为xcuserstate的文件。如果你只想忽略特定文件,比如UserInterfaceState.xcuserstate,可以直接写文件名:
UserInterfaceState.xcuserstate
请注意,如果UserInterfaceState.xcuserstate文件已经被Git跟踪,上述方法不会立即生效。你需要先使用以下命令从Git索引中移除该文件:

git rm --cached UserInterfaceState.xcuserstate
git rm --cached psa.xcworkspace/xcuserdata/nmuser.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

然后提交这次改变:

git commit -m "Stop tracking UserInterfaceState.xcuserstate file"

之后,.gitignore文件中的规则将会生效。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容