用EGit将eclipse项目推送到GitHub [英] Push eclipse project to GitHub with EGit
问题描述
关键在于在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屋!