开发者

How to get a specific directory structure when pushing an Eclipse project to github?

开发者 https://www.devze.com 2023-03-17 04:33 出处:网络
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. T

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:

  1. push the way you have there.
  2. do a clone at command level.
  3. use git mv to eliminate the extra level.
  4. push the results.
  5. point Eclipse at this structure, it will be perfectly happy, via 'import existing project'.
0

精彩评论

暂无评论...
验证码 换一张
取 消