So I have created a project before in Eclipse and then pushed it to a github repository that I set up. The only problem is that it used the project directory as the root directory of the repository. This is not the way anyone else sets up their repositories and so I don't want to setup mine like this either.
Here is what is happening:
GitH开发者_StackOverflow中文版ub Repository 1
- ProjectName
- src
- test
- .project
- readme.md
And here is what I actually want:
GitHub Repository 1
- src
- test
- .project
- readme.md
I am using the Eclipse Git plugin, but I don't see anyway of specifying that I want to use the second directory structure. Does anyone know how to achieve this in Eclipse? Thanks!
Not automatically from eclipse. You can:
- push the way you have there.
- do a clone at command level.
- use git mv to eliminate the extra level.
- push the results.
- point Eclipse at this structure, it will be perfectly happy, via 'import existing project'.
精彩评论