简体   繁体   English

如何使用EGIT将现有Eclipse项目推送到Bitbucket?

[英]How Do I Push an Existing Eclipse Project Up to Bitbucket With EGIT?

I have a project for an interview I need to get onto Bitbucket. 我有一个项目需要进入Bitbucket进行面试。 I normally use Github, so the slight change is throwing me off. 我通常使用Github,所以稍微改变就是让我失望。 I coded the project, tested it, and it works fine. 我对项目进行了编码,对其进行了测试,并且工作正常。 Now I want to get it up on the repository, but can't. 现在我想在存储库中获取它,但不能。 I installed EGIT to my Eclipse instance on my local, and while it will attach itself to the empty online repository it won't allow me to import my local code to a do a push and commit. 我将EGIT安装到我本地的Eclipse实例上,虽然它将自己附加到空的在线存储库,但它不允许我将本地代码导入到执行推送和提交。

Can anyone advise on the simplest way I can get this taken care of? 任何人都能以最简单的方式提出建议吗?

With EGit on Neon: right-click on project > Team > Push branch...., you'll see the push dialog and a button to create a new remote. 使用EGit on Neon:右键单击项目>团队>推送分支....,您将看到推送对话框和创建新远程按钮。 Click this button, configure the bitbucket repo, Finish. 单击此按钮,配置bitbucket repo,Finish。 Then the repo should be available in the Push Dialog. 然后回购应该在推送对话框中可用。 So select it as target and press Finish. 因此选择它作为目标并按Finish。

In Bitbucket you can import project from github. 在Bitbucket中,您可以从github导入项目。

But if you want to change git remote origin and send the whole project again to Bitbucket get to this file : .git/config and change the [remote "origin"] section to the Bitbucket repo http or ssh and then: 但是如果你想改变git远程源并再次将整个项目发送到Bitbucket,请转到这个文件: .git/config并将[remote "origin"]部分更改为Bitbucket repo httpssh然后:

git add all or git add . git add allgit add .

git commit -m "last commit massage ..."

git push -u origin master

I recommand to use Gitlab instead of Bitbucket for private repo. 我建议使用Gitlab而不是Bitbucket进行私人回购。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM