用EGit将eclipse项目推送到GitHub [英] Push eclipse project to GitHub with EGit

查看:197
本文介绍了用EGit将eclipse项目推送到GitHub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EGit将项目成功推向GitHub。我的存储库叫HelloWorld。我的eclipse项目也被称为HelloWorld。我的问题是当我推动项目时,将项目上传到文件夹HelloWorld下。所以结果是存储库HelloWorld然后是文件夹HelloWorld和src文件夹。在这里更容易理解的是项目的链接。我想在存储库HelloWorld下拥有src文件夹。如何实现?

解决方案

关键在于在eclipse中创建项目时。



首先,在eclipse中创建Java项目。右键单击项目,然后选择团队>共享> Git



在配置Git存储库对话框中,确保选择在项目的父文件夹中创建Repository。
然后你可以推送到github。



注意:Eclipse会给你一个关于将git仓库放在你的工作空间的警告。因此,当您创建项目时,将项目目录设置在默认工作区之外。


I am successfully pushing my project to GitHub using EGit. My repository is called HelloWorld. My project in eclipse is also called HelloWorld. My problem is when i push the project it is upload the project under the folder HelloWorld. So the result is the repository HelloWorld then the folder HelloWorld and the the src folder. To be more understandable here is the link of the project. I want under the repository HelloWorld to have the src folder. How can I achieve that?

解决方案

The key lies in when you create the project in eclipse.

First step, you create the Java project in eclipse. Right click on the project and choose Team > Share>Git.

In the Configure Git Repository dialog, ensure that you select the option to create the Repository in the parent folder of the project.. Then you can push to github.

N.B: Eclipse will give you a warning about putting git repositories in your workspace. So when you create your project, set your project directory outside the default workspace.

这篇关于用EGit将eclipse项目推送到GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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