When I commit a project an extra project dir is created

送分小仙女□ 提交于 2019-12-10 12:59:30

问题


I commit a project on github using these steps :

Right click your project, select Team -> Share Project -> Git. Select the proposed line and press "Create repository". Press finish.

Right-mouse click on your project and select "Team" -> "Push". A dialog pops up. Maintain the following data. Adjust the hightlighted line so that you are using your user and your project name.

But when I view my project on github this is my project structure : myproject -> myproject -> src

When it should be : myproject -> src

So an extra level with the project name is being created on github. Am I commiting the project correctly ?

When I try to share the project with "Use or create repository in parent folder of project" enabled the project path is "c:\homedir\git\egit-test1\egit-test1" Should it not be "c:\homedir\git\egit-test1\" ?

Screenshot attached :


回答1:


If you don't want the additional directory level in your git repository, you need to enable the "Use or create repository in parent folder of project" option at the very top of the "Configure Git Repository" dialog (Team -> Share Project... -> Git).

However, this will create the repository directly in your workspace and not in the default repository folder, which is not recommended. But you can move the project to the right place and re-import it into your workspace in a second step.

Another option would be to create the repository on github first. Afterwards you can clone the github repository and move your code into it.




回答2:


i) pull code in local repository.

ii) copy code into seprate folder.

iii) delete all hidden files and .git .

iv) copy code again in your local repository.

v) commit and push



来源:https://stackoverflow.com/questions/12462784/when-i-commit-a-project-an-extra-project-dir-is-created

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!