清除git本地缓存和gitigore模板

一、清除git本地缓存

首先,.gitignore 只能忽略那些没有被追踪(track)的文件,且git存在本地缓存。
如果需要过滤文件之前已纳入了版本管理,那么除了修改ignore文件,还要清除本地缓存。

git rm -r --cached .
git add .
git commit -m "update .gitignore"

二、ignore文件模板

1. 后端

# Compiled class file
*.class

# Log file
*.log
*.imi
*.lst

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.idea
*.iml
out
.settings/
.project
.classpath
/*/target/
logs/
.txlcn

# ignore test file
**/src/test/

2. 前端

.DS_Store
# node_modules 正常工作时需要过滤该文件
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-eroor.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值