当我提交一个项目时,会创建一个额外的项目目录 [英] When I commit a project an extra project dir is created

查看:199
本文介绍了当我提交一个项目时,会创建一个额外的项目目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这些步骤在github上提交项目:


右键单击您的项目,选择团队 - >共享项目 - > Git。选择建议的
行,然后按创建存储库。按完成。



右键单击您的项目并选择Team - >Push。弹出
对话框。维护以下数据。调整高亮的
行,以便使用用户和项目名称。

github这是我的项目结构:
myproject - > myproject - > src



当它应该是:
myproject - > src



因此,在github上创建了一个额外的项目名称。我正在提交项目吗?



当我尝试使用在项目的父文件夹中使用或创建存储库共享项目时,项目路径为c:\\ \\ homedir \git\egit-test1\egit-test1它应该不是c:\homedir\\git\egit-test1\吗?



附带屏幕截图:

共享项目... - > Git)。

然而,这将直接在工作区创建仓库,不在默认存储库文件夹中,这是不推荐的。但您可以将项目移动到正确的位置,并在第二步中将其重新导入到您的工作区中。



另一种选择是首先在github上创建存储库。之后,您可以克隆github存储库并将您的代码移入其中。


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 :

解决方案

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.

这篇关于当我提交一个项目时,会创建一个额外的项目目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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