git添加忽略文件

git添加忽略文件,第1张

1,打开终端,cd到项目目录下

2,touch .gitignore 创建忽略文件

3,回到工程中shift+command+. 打开隐藏文件,找到.gitignore文件

4,打开.gitignore文件,编辑写入:

*.xcuserstate

project.xcworkspace 

xcuserdata 

UserInterfaceState.xcuserstate 

project.xcworkspace/ 

xcuserdata/ 

UserInterface.xcuserstate

5,保存关闭.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

1、打开webstorm的settings

2、找到Directories

3、将要忽略的文件夹标记为Exclude(选中文件夹,点击上面菜单Exclude即可)

4、确认

找到.gitignore文件,在其中添加要忽略的文件或文件夹即可

.DS_Store

node_modules/

dist/

npm-debug.log*

yarn-debug.log*

yarn-error.log*


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11451169.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存