git 将 Eclipse 项目连接到新的 GitHub 存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14713676/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Connecting Eclipse project to new GitHub repo
提问by IAmYourFaja
I have been coding up a new project for several weeks and finally decided to put it up on GitHub. So I installed Git (sudo apt-get install git
), created an account on GitHub, and then created a new repository with the same name as my Eclipse project. I'm now trying to add my existing Eclipse project to Git version control, and connect it to my GitHub repository.
几个星期以来,我一直在编写一个新项目,最后决定把它放在 GitHub 上。所以我安装了 Git ( sudo apt-get install git
),在 GitHub 上创建了一个帐户,然后创建了一个与我的 Eclipse 项目同名的新存储库。我现在正在尝试将我现有的 Eclipse 项目添加到 Git 版本控制,并将其连接到我的 GitHub 存储库。
I ran git init /home/myuser/sandbox/workspace/MyApp
.
我跑了git init /home/myuser/sandbox/workspace/MyApp
。
How do I now connect it to my HitHub repo, so that when I git push
some changes, I'll be able to login to GitHub and see them?
我现在如何将它连接到我的 HitHub 存储库,以便当我进行git push
一些更改时,我将能够登录到 GitHub 并查看它们?
回答by mishadoff
The simplest (and probably the best) method to install EGitplugin, and then either import from local repository or from github
安装EGit插件的最简单(也可能是最好的)方法,然后从本地存储库或从 github 导入
If you already have eclipse project you can just 'right click' on it and 'share'. After select provider (git) just add your github repo url and have fun.
如果您已经有 Eclipse 项目,您只需“右键单击”它并“共享”即可。选择提供者 (git) 后,只需添加您的 github repo url 并享受乐趣。