当前位置: 动力学知识库 > 问答 > 编程问答 >

eclipse - Use git for project without deleting

问题描述:

I have this project in eclipse that has 9000+ lines of code that I have been working on, so I decided it is about time I got version control for it. So I installed egit for eclipse and added a project to a respository. Unfortinitely, when I did this, git moved the project from where it was located to its own location, introducing bugs. So now I have to find a way to take git away from the project (remove project from version control) and make git use the project again, this time without moving it.

Visual representation

this is what happened:

project original source: C://something/something/project

| files

|

v

git repository: C://something/git/project

this is what I need to do:

git repository ----------> original source

eclipse resolves workspace vars it has changed

project uses version control, git does not move the files

git creates a master repository for files that are committed from the main location (C://something/something/project)

网友答案:

Move the project back where it was. Git repository is nothing but a .git (notice the dot in the front) directory and can be moved together with code as it's not depended on absolute paths in any way. Egit should be able to pick it up from new location, and if it doesn't, init the repo from the command line.

分享给朋友:
您可能感兴趣的文章:
随机阅读: