从git仓库中删除.idea文件夹的小技巧
1 echo '.idea' >> .gitignore 2.将.gitignore文件上传到远程仓库 1 git pull git add .gitignore git commit -m 'edit .gitignore' git push origin master 3.删除git的.idea文件 1 git rm --cached -r .idea 4.同步到远程仓库 1 git commit -m 'delete .idea' git push origin master 完成之后就可以发现git仓库中的.idea文件已经被删除,而且之后push代码也不会再把.idea文件上传。 PS:我在使用PyCharm编写python代码,一般是通过new -> .ignore file -> .gitignore file自动生成.gitignore文件。 下面是我自己比较常用的.gitignore文件简短配置: 1 .project .settings/ .prefs .pydevproject .idea/ .idea .DS_Store .cache *.pyc *.html *.xlm (编辑:焦作站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |