如何移动Egit存储库和工作目录 [英] How to move Egit repository and working directory

查看:89
本文介绍了如何移动Egit存储库和工作目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Egit的新手,并为我正在开展的GWT项目创建了一个新的存储库。不幸的是,我让它创建了我的Dropbox文件夹下的存储库,现在我很遗憾,因为我正在互联网上同步兆字节的临时文件(例如* .class)。 创建存储库向导还将项目的文件从Eclipse工作区移动到Dropbox下的工作目录(与.git文件夹一起)。



什么是简单的方法为了让我将这个Egit存储库和工作目录移动到其他地方,除了Dropbox文件夹?



(btw,因为我使用Egit,解决方案需要工作这样Eclipse很快乐,我可以继续构建/使用我的项目)。

解决方案

我自己做了,这里是如何:




  • 在Eclipse中,右键单击MyApp项目, Refactor-> Move 。将Eclipse项目移动到磁盘上的新位置。请注意,我保留了 ... / GitRepositories / MyApp / MyApp dir结构,只是我将GitRepositories的位置移动到新的位置。还要注意的是,这只剩下旧的目录,只有它里面的.git文件夹(即Eclipse移动了工作文件/目录但不是repo)。

  • 关闭Eclipse

  • 将.git目录从旧目录移动到新目录。一定要保持在正确的相对位置!我不小心把。$ code ... ... / GitRepositories / MyApp 移动到$ code> ... / GitRepositories / MyApp / MyApp 。这个东西已经搞砸了,我不得不追踪...

  • 启动Eclipse



可能已经在这一点上工作了,但是因为我第一次将.git移动到错误的地方,所以我不得不执行以下步骤:




  • 右键单击MyApp项目, Team->断开连接

  • 右键单击MyApp项目, Team->共享项目...

  • 该向导会自动找到相对于项目目录的Git报告: ../。 git



快乐黑客...


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

解决方案

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

这篇关于如何移动Egit存储库和工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆