Search code examples
gitgithubrubymine

RubyMine project directory disappears after git pull


My coworker and I started working on the same project using GitHub and RubyMine.

Our original sin was to push .idea folder (created and updated automatically by RubyMine) in my local repository to GitHub. This folder creates conflict with my co-worker's local repository every time he pulls from remote.

To fix this issue, we have to delete .idea folder from remote repository. Now, from my master branch, I pull from remote repository, and it seems that .idea files were removed (I am not sure). Therefore, RubyMine won't let me see my project folders (i.e., app, config, public) in Project view, even though these folders are still there.

My question is: how can I restore original setting in RubyMine where I can see my project folders?


Solution

  • The only files from .idea folder that you should not push are workspace.xml and tasks.xml. First you should untrack those files with:

    git rm --cached .idea/workspace.xml
    git rm --cached .idea/tasks.xml
    

    Next add them to .gitignore:

    .idea/workspace.xml
    .idea/tasks.xml
    

    Now simply remove .idea folder and reopen the project folder with rubymine.