AdamNYC
AdamNYC

Reputation: 20425

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?

Upvotes: 4

Views: 1655

Answers (2)

Benjamin Crouzier
Benjamin Crouzier

Reputation: 41935

You can try the following:

  • Make sur your project is versionned with git (run git info)
  • Close rubymine and reopen it
  • Pay attention to messages on the top right : find the message complaining that "git root is unregistered"
  • Click on register git root in the message
  • In the configuration window, click the message in red: add git root
  • Quickdiffs in files should work now.

If you don't have the message about git when you open rubymine, you can go to the options (command+,), then search version control and click on the first result. Then you should have a table with 2 columns:

/-----------------------------\
| Directory          | VCS    |
+--------------------+--------+
| <Project>          | <none> |
+--------------------+--------+
| /home/user/project | Git    |
\-----------------------------/

If your project is not listed here, try adding it.

Upvotes: 0

Jordi
Jordi

Reputation: 551

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.

Upvotes: 7

Related Questions