Take the 2-minute tour ×

I am new to Egit and created a new repository for a GWT project I'm working on. Unfortunately, I let it create the repository under my Dropbox folder, and now I'm regretting it because I'm syncing megabytes of temp files (e.g. *.class) over the internet. The "create repository" wizard also moved the project's files from the Eclipse workspace to a working directory under Dropbox (along with the .git folder).

What is an easy way for me to move this Egit repository and working directory to somewhere else, other than the Dropbox folder?

(btw, since I'm using Egit, the solution needs to work such that Eclipse is happy and I can keep building/using my project).

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

I managed to do it myself, here's how:

  • In Eclipse, right-click MyApp project, Refactor->Move. Move the Eclipse project to a new spot on disk. Note that I kept the .../GitRepositories/MyApp/MyApp dir structure, it's just that I moved the location of GitRepositories to a new place. Also note that this left the old dir with nothing but the .git folder inside it (i.e. Eclipse moved the working files/dirs but not the repo).
  • Close Eclipse
  • Move the .git directory from the old directory to the new. Be sure to keep it in the right relative place! I accidentally moved .git from .../GitRepositories/MyApp to .../GitRepositories/MyApp/MyApp. This screwed things up and I had to back track...
  • Start Eclipse

It might already work at this point, but because I moved .git to the wrong place when I first did it, I had to do the following steps:

  • Right-click MyApp project, Team->Disconnect
  • Right-click MyApp project, Team->Share Project...
  • The wizard automatically finds the Git report relative to the project dir: ../.git

Happy hacking...

share|improve this answer
It is really helpfule. When reopen Eclipse, in Git repositories view, it asks to create a new repository or to add an existing one. –  chance Nov 2 '12 at 11:03
add comment

When working with a local repository, you can just do the following:

  1. Close Eclipse
  2. Move the git repository on disk
  3. Reopen Eclipse
  4. Select File->Import... -> Git -> Projects from Git
  5. Select local repository and add the new repository location
  6. Select your project(s) to be added
  7. (Optional) Remove the old project references from your workspace.

It may seem like a lot of steps, but it's actually very simple and less invasive than moving the repo and working copy separately.

share|improve this answer
add comment

Your Answer


