git 如何在 Pycharm 中使用 gitignore?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36251746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use gitignore in Pycharm?
提问by cb4
Similar questions like this oneabout how to ignore files in a git repo are typically answered by showing which git command to execute on the command line. Even this one, although it is PyCharm specific, does the same.
类似的问题,像这样的一个有关如何忽略一个混帐回购协议文件通常通过展示git的命令在命令行中执行哪个回答。即使是这个,虽然它是 PyCharm 特定的,但也是如此。
Is there a way to manage this file through the PyCharm GUI?
有没有办法通过 PyCharm GUI 管理这个文件?
回答by Gavin Munro
Try:
尝试:
- Go to Settings
- Go to Plugins
- Search for: .ignore
- Install
- Restart PyCharm
- 前往设置
- 转到插件
- 搜索:.ignore
- 安装
- 重启 PyCharm
.gitignore
should now be included in .ignore
along with .hgignore
etc.
.gitignore
现在应该.ignore
与.hgignore
等一起包括在内。
回答by Makoto
回答by adixxov
In PyCharm Pro 2019.3, I was able to do this by - right click folder or file I wanted to add to gitignore. - scroll to and click on Git - scroll to and click on Add to .gitignore If a gitignore file is not already there, PyCharm will create one and add it to the main project folder and add your chosen folder/file to it.
在 PyCharm Pro 2019.3 中,我可以通过右键单击要添加到 gitignore 的文件夹或文件来执行此操作。- 滚动到并单击 Git - 滚动到并单击添加到 .gitignore 如果 gitignore 文件不存在,PyCharm 将创建一个并将其添加到主项目文件夹并将您选择的文件夹/文件添加到其中。