.idea文件夹如何取消版本控制

今天在上gitee仓库上传第一版源码时,不小心将工程下的.idea文件夹及其文件都传上去了,所以要取消该文件夹的版本控制。
执行如下命令:

# 先执行删除命令
$ git rm -r --cached ".idea"
# 提交到本地
$ git commit -m "del .idea file"
# 推送到远程仓库
$ git push -u origin "master"

这样处理完成后,下次同步的时候还会要求提交,所以需要在本地设置该文件夹的文件不同步,所以还得设置一下,在工程根目录下新建一个文件.gitignore,内容如下:

# Compiled class file
*.class
*.classpath
*.factorypath

# Log file
*.log

# BlueJ files
*.ctxt

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

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


# IDE Files #
*.iml
.idea
.idea/
.project
.settings
target
.DS_Store

# temp ignore
*.cache
*.diff
*.patch
*.tmp

# Maven ignore
.flattened-pom.xml

然后将.gitignore提交即可。

$ git add .gitignore
$ git commit -m "add .gitignore file"
$ git push -u origin "master"
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jinwen5290

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值