Rubymine: How to make Git ignore .idea files created by Rubymine

前端 未结 18 1871
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 08:35

I use Rubymine for Rails projects. Very often, Rubymine makes changes in .idea/* files that I don\'t care about. But it keeps preventing me from checking out ne

相关标签:
18条回答
  • 2020-12-07 09:20

    Note that JetBrains recommends "If you decide to share IDE project files with other developers...", tracking all the .idea/* files except for the following:

    • workspace.xml
    • usage.statistics.xml
    • tasks.xml
    • the shelf/ directory

    So to follow their advice, you would add those to your .gitignore.


    Source:

    If you decide to share IDE project files with other developers, follow these guidelines:
    ...
    Here is what you need to share:

    • All the files under .idea directory in the project root except the workspace.xml, usage.statistics.xml, and tasks.xml files and the shelf directory which store user specific settings
    • ...

    How to manage projects under Version Control Systems (archive)

    There's some additional notes and discussion on that page that you should read if you're considering going ahead with this,
    including additional files you may want to gitignore even if you decided you want to share IDE files (e.g. .iml files, .idea/modules.xml, gradle.xml, user dictionaries folder, additional files that are generated from gradle or maven).

    0 讨论(0)
  • 2020-12-07 09:20

    if a file is already being tracked by Git, adding the file to .gitignore won’t stop Git from tracking it. You’ll need to do git rm the offending file(s) first, then add to your .gitignore.

    Adding .idea/ should work

    0 讨论(0)
  • 2020-12-07 09:24

    Close PHP Storm in terminal go to the project folder type

    git rm -rf .idea; git commit -m "delete .idea"; git push;
    

    Then go to project folder and delete the folder .idea

    sudo rm -r .idea/
    

    Start PhpStorm and you are done

    0 讨论(0)
  • 2020-12-07 09:24

    Add .idea to ~/.gitignore_global and follow the instructions here to get .gitignore_global working:

    Git global ignore not working

    Then you don't have to ever add it to an individual .gitignore file.

    0 讨论(0)
  • 2020-12-07 09:25

    Try git rm -r --cached .idea in your terminal. It disables the change tracking.

    0 讨论(0)
  • 2020-12-07 09:26

    In the rubymine gui, there is an ignore list (settings/version control). Maybe try disabling it there. I got the hint from their support guys.

    enter image description here

    0 讨论(0)
提交回复
热议问题