繁体   English   中英

从Eclipse内部将本地Git存储库推送到远程Google Cloud Repository?

[英]Pushing local Git repository to remote Google Cloud Repository from inside Eclipse?

我正在尝试首次将Eclipse项目的本地Git存储库推送到Google Cloud Repository中。

为此,我选择了Team | 从Eclipse Project Explorer中的Eclipse(Mars)项目的上下文菜单中Push Branch 'master' ,然后提供以下信息:

  • 远程名称: google
  • URI: https://source.developers.google.com/p/<x>/https://source.developers.google.com/p/<x>/ x https://source.developers.google.com/p/<x>/其中x是我的Google Cloud Platform项目的名称
  • 用户:我的<y>@gmail.com表单的Google帐户名,即有效的电子邮件地址
  • 密码:我的Google帐户密码

接下来,我再次出现两个对话框,再次请求https://source.developers.google.com/p/<x>/的存储库凭据(好像第一个会被拒绝,但是为什么?)和我提供相同的凭据(用户,密码)两次。

此时,我遇到此错误消息:

Can´t connect to any URI: https://source.developers.google.com/p/<x>/   
(https://source.developers.google.com/p/<x>/ not authorized)

可能有什么不对? 在推送到Google Cloud Repository时,我应该使用另一个凭据而不是(全局)凭据来推送到Google Cloud Repository(从安全角度看似乎是明智的),如果是这样,我怎么能获得一个? 总的来说,从Eclipse内部执行这种推送的正确方法是什么,而不是在命令行上

毕竟我最终是从命令行做的:

cd <local-git-repository>
# pwd contains .git; try git status
# gcloud init was already run
git config credential.helper gcloud.sh
git remote add google https://source.developers.google.com/p/<x>/

这包括以下效果:

  1. 源代码现在可以在Google Cloud Repository中查看,例如来自Google Developers Console
  2. 远程Git存储库现在在Eclipse(Mars)中可见,配置为远程存储库google: https://source.developers.google.com/p/<x>/

暂无
暂无

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

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