在項(xiàng)目中有一些文件需要忽略不需要跟蹤提交到遠(yuǎn)端服務(wù)器,我們做如下設(shè)置篮撑。
cd worksapce 到工程根目錄下
touch .gitignore 創(chuàng)建忽略文件
vim .gitignore vim編輯文件
去GitHub搜索gitignore 找到對(duì)應(yīng)語(yǔ)言的內(nèi)容打開復(fù)制到vim編輯
git esc 退出
shift + :輸入 wq浅蚪!保存并退出
然后找到忽略文件退回工作區(qū)在放進(jìn)忽略文件中忽略
git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
在把這段代碼粘貼gitignore中
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
在進(jìn)行add commit push到遠(yuǎn)端 之后在commit就不會(huì)再出現(xiàn)這個(gè)文件了
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者