1竭翠,打開終端羡亩,cd到項目目錄下
2顾腊,touch .gitignore 創(chuàng)建忽略文件
3,回到工程中shift+command+. 打開隱藏文件吴侦,找到.gitignore文件
4屋休,打開.gitignore文件,編輯寫入:
*.xcuserstate
project.xcworkspace?
xcuserdata?
UserInterfaceState.xcuserstate?
project.xcworkspace/?
xcuserdata/?
UserInterface.xcuserstate
5备韧,保存關(guān)閉.gitignore文件
6劫樟,退出Xcode,在終端輸入?git rm --cached YourProjectName.xcworkspace/xcuserdata/YourUsername.xcuserdatad/UserInterfaceState.xcuserstate
7织堂,在終端輸入:git commit -m"Removed file that shouldn't be tracked"
8叠艳,重新打開Xcode,git commit 易阳,git push