How to move Egit repository and working directory

前端 未结 2 381
情话喂你
情话喂你 2020-12-17 00:02

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 regrett

2条回答
  •  情深已故
    2020-12-17 00:34

    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...

提交回复
热议问题