[英]Pushing local Git repository to remote Google Cloud Repository from inside Eclipse?
I am attempting a push of the an Eclipse project's local Git repository into a Google Cloud Repository for the first time. 我正在尝试首次将Eclipse项目的本地Git存储库推送到Google Cloud Repository中。
To this end I select Team
| 为此,我选择了Team
| Push Branch 'master'
from my Eclipse (Mars) project's context menu in the Eclipse Project Explorer and then provide the following information: 从Eclipse Project Explorer中的Eclipse(Mars)项目的上下文菜单中Push Branch 'master'
,然后提供以下信息:
google
远程名称: google
https://source.developers.google.com/p/<x>/
where x
is the name of my Google Cloud Platform project 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
, ie a valid e-mail address 用户:我的<y>@gmail.com
表单的Google帐户名,即有效的电子邮件地址 Next, I am presented twice with a further dialog box that again asks for credentials for the repository at https://source.developers.google.com/p/<x>/
(as if the first one would have been rejected, but why?) and I provide the same credentials (User, Password) two more times. 接下来,我再次出现两个对话框,再次请求https://source.developers.google.com/p/<x>/
的存储库凭据(好像第一个会被拒绝,但是为什么?)和我提供相同的凭据(用户,密码)两次。
At this point, I run into this error message: 此时,我遇到此错误消息:
Can´t connect to any URI: https://source.developers.google.com/p/<x>/
(https://source.developers.google.com/p/<x>/ not authorized)
What could be wrong? 可能有什么不对? Am I supposed to use another credential than the (global) one for my Google Account when pushing to a Google Cloud Repository (as would seem wise from a security perspective), and if so, how could I obtain one? 在推送到Google Cloud Repository时,我应该使用另一个凭据而不是(全局)凭据来推送到Google Cloud Repository(从安全角度看似乎是明智的),如果是这样,我怎么能获得一个? Overall, what is the right recipe for executing this kind of push from inside Eclipse as opposed to on a command-line ? 总的来说,从Eclipse内部执行这种推送的正确方法是什么,而不是在命令行上 ?
I ended up doing it from the command line after all: 毕竟我最终是从命令行做的:
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>/
This includes the following effects: 这包括以下效果:
google: https://source.developers.google.com/p/<x>/
远程Git存储库现在在Eclipse(Mars)中可见,配置为远程存储库google: https://source.developers.google.com/p/<x>/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.