How to stop pycharm show files in project in red color?

淺唱寂寞╮ 提交于 2020-06-14 07:27:33

问题


I would like to create project in PyCharm by open directory. I use https://github.com/metachris/tornado-boilerplate as a root of the project. I encountered that files are shown in red color in project window. It's really annoying thing.

I found this https://www.jetbrains.com/idea/help/file-status-highlights.html. But I can't figure out how to get rid of the issue.

enter image description here

When I open empty directory and then create file just

$ touch file

It's color is red too.

Thanx.


回答1:


Did you start you project within a directory that is under version control? The red color normally shows up when files are in a version controlled directory, but are untracked.

If this is the problem, you can solve it a few ways:

  1. Add all of the files to your vcs.
  2. Add the files to the ignore file of your vcs (.gitignore if you're using git)
  3. Move the project out of the repo under vcs.



回答2:


You can change the file color to whatever you want. File > Settings > Editor > Colors&Fonts > File Status > (Unkown > foreground).

The files in Pycharm are under Version Control. Pycharm changes the file's color by the status of file. The 'red' color of the file you mentioned indicated that the file is 'Unkown' status to the version control. If you add the 'Unkonwn' file to version control and commit to repository, the 'red' color can be changed.




回答3:


Judging by the brown color of your files it looks like your project directory is under version control and that all the files in your project are not versioned. Check your File | Settings | Version Control settings and check the VCS status of these files in View | Tool Windows | Version Control | Local Changes.




回答4:


Looks like the color is Brawn and the main reason for red color in files is that file exists locally, but is not in the repository, and is not scheduled for adding. So make sure that you check the files when you adding them in CVS. Works for me.




回答5:


The files in Pycharm are under Version Control System (like git, cvs etc). To remove the 'red' color of the file you need to add that file to git repository (or any other VCS).

If you are using git,
Right click the file → git → commit file → select the file → commit
then, ctrl+shift+k to push it to the repository.




回答6:


File -> Settings -> Version Control -> File Status Color -> Unknown



来源:https://stackoverflow.com/questions/30385143/how-to-stop-pycharm-show-files-in-project-in-red-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!