1.通过插件安装:Pycharm->preferences->Editor->Plugins
搜索.ignore</p><p/><div class="image-package"><img src="https://img.haomeiwen.com/i2110168/7baaeb89f64506c1.png" class="uploaded-img" style="min-height:200px;min-width:200px;" width="auto" height="auto"/>
</div><p>
</p><p>
2.插件安装完成后在根目录下创建.gitignore文件</p><p/><div class="image-package"><img src="https://img.haomeiwen.com/i2110168/0e5a66307f56eaec.png" class="uploaded-img" style="min-height:200px;min-width:200px;" width="auto" height="auto"/>
</div><p/><div class="image-package"><img src="https://img.haomeiwen.com/i2110168/5440b3c9ffe5ca23.png" class="uploaded-img" style="min-height:200px;min-width:200px;" width="auto" height="auto"/>
</div><p>
</p><p>
</p><p>
或者从官网下载对应插件:https://plugins.jetbrains.com/plugin/7495--ignore</p><p>然后导入</p><p/><div class="image-package"><img src="https://img.haomeiwen.com/i2110168/ac9b4211bee53e36.png" class="uploaded-img" style="min-height:200px;min-width:200px;" width="auto" height="auto"/>
</div><p>
</p><p>
</p><p>完成后即可,编辑<span>gitignore文件</span></p><p>
3.实践过程遇到问题是,编辑文件未及时生效:</p><p>
解决方案: gitignore只会忽略在.gitignore编写之后的未跟踪(untrack)文件,而在编写.gitignore之前已经add and commit的文件则不会被忽略</p><p>解决,清除git缓存,重新添加 </p><p>git rm -r --cached . //清除缓存,最后有点
网友评论