集成Eclipse和GitHub [英] Integrating Eclipse and GitHub
问题描述
我需要帮助设置Eclipse,以便我可以将我的代码推送到我的GitHub帐户。我已经在线搜索,我发现的教程是过时的或不适合我。
I am in need of help in trying to setup Eclipse so that I can push my code onto my GitHub account. I've searched online and the tutorials I have found are either outdated or don't work for me.
我已经在Eclipse上有一个项目。我该怎么把代码放到GitHub上?有人请加详细的说明。任何帮助是赞赏。
I already have a project on Eclipse. How would I put that code onto GitHub? Would someone please add detailed instructions please. Any help is appreciated.
EDIT
一旦我发布了这个问题,随着设置的变化,我设法让它工作!什么是巧合...
EDIT As soon as I posted this question, and fiddling around with the settings I managed to get it to work! What a coincidence...
现在我唯一的问题是如何设置,以便在提交时只会选择项目文件夹中的文件?现在它在包资源管理器中显示所有600个文件。
The only problem I have now is how do I set it up so that when I commit it will only select the files in the project folder? Right now it is showing all 600 files in the Package Explorer.
推荐答案
好的,有几种方法可以做到这一点。我发现这是最简单的方法:
Alright, there are several ways of doing this. I found this to be the easiest way:
首先,设置SSH2配置。转到 Windows
- > 首选项
- > 一般
- > 网络连接
- > SSH2
- > 密钥管理
code>生成RSA密钥。 保存密钥
First, set up SSH2 configurations. Go to Windows
->Preferences
->General
->Network Connections
->SSH2
->Key Management
and Generate RSA Key
. Save Key
复制该密钥。您将需要转到您的GitHub帐户设置,并将新的SSH密钥添加到您的帐户。
Copy that key. You will need to go to your GitHub account settings and add the new SSH key to your account.
现在,您需要安装eGit:
Now, you need to install eGit:
接下来,您要添加Git Repositories视图:
Next, you want to add the Git Repositories view:
< img src =https://i.stack.imgur.com/4ruNL.pngalt =enter image description here>
创建一个新的Git Repository。我已经创建了一个名为 Java
的存储库。其余的解释我将参考该回购。
Create a new Git Repository. I have already created a repository called Java
. I will refer to that repo for the rest of the explanation.
创建存储库后,应显示在Git Repositories视图中。现在要将项目添加到存储库中,右键单击项目,然后选择Team-> Share Project。
After you create your repository, it should show up in the Git Repositories view. Now to add your project to the repository, right click on your project and select Team->Share Project.
选择刚创建的存储库。您还可以使用CTRL +选择多个项目并将它们放在一个存储库中。
Select the repository you just created. You can also use CTRL+ to select multiple projects and place them in one repository.
现在回到你的Git Repositories视图。转到远程。右键单击并选择创建远程。
Now go back to your Git Repositories view. Go to Remotes . Right click and select Create Remote.
选择更改...
,然后在GitHub上输入您的存储库的SSH链接。
对于连接,选择SSH。然后按完成。
对于修订映射,选择高级...
。
对于来源Ref
选择 refs / heads / master
。然后按添加规格
,然后选择将规格保存在origin配置中。然后按完成。
团队
这几乎是这样。您可以通过右键单击项目来提交更改 - > - >
提交...`
Select Change...
and enter the SSH link for your Repository on GitHub.
For connection, select SSH. Then press Finish.
For Rev-mapping, select Advanced...
.
For Source Ref
select refs/heads/master
. And then press Add Spec
, then select Save specifications in 'origin' configuration. Then press finish.
That's pretty much it. You can commit changes by right clicking your project - >
Team->
Commit...`
将新的提交推送到GitHub:
这是一个很好的解释,关于如何设置Eclipse拉请求。
This is a really good explanation on how to set up Eclipse pull requests.
当前分支未配置为拉配置中没有值用于配置中发现的关键branch.master.merge
这篇关于集成Eclipse和GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!