简体   繁体   English

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

[英]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' ,然后提供以下信息:

  • Remote name: google 远程名称: google
  • URI: 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项目的名称
  • User: my Google account name of the form <y>@gmail.com , ie a valid e-mail address 用户:我的<y>@gmail.com表单的Google帐户名,即有效的电子邮件地址
  • Password: my Google account password 密码:我的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: 这包括以下效果:

  1. Source code now visible inside Google Cloud Repository eg from Google Developers Console 源代码现在可以在Google Cloud Repository中查看,例如来自Google Developers Console
  2. Remote Git repository now visible inside Eclipse (Mars) as configured remote repository 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.

相关问题 从Eclipse推送到特定位置的远程存储库 - Pushing from Eclipse to remote repository at specific location 我们的git远程存储库未与本地存储库同步 - Our git remote repository is not synchronized with local repository 新的远程存储库Eclipse Git - New remote repository eclipse git 推送到远程时出现 Eclipse git 错误:传输错误:无法获取远程存储库引用 - Eclipse git error when pushing to remote: Transport Error: Cannot get remote repository refs 将更改从Bitbucket更新到Eclipse中的本地git存储库? - Update changes from Bitbucket to local git repository in Eclipse? 如何从git本地存储库中隔离Eclipse工作区? - How to isolate Eclipse workspace from git local repository? 从Eclipse中删除git存储库 - Remove git repository from Eclipse Egit:如何将Eclipse项目(本地存储库)与远程存储库同步 - Egit: how to synchronize eclipse project ( local repository) with the remote repository 通过 HTTPS 从 Eclipse 推送到我的 GitHub 存储库停止工作:“git-receive-pack not allowed”错误 - Pushing from Eclipse to my GitHub repository via HTTPS stopped working: "git-receive-pack not permitted" error 如何使用 Eclipse EGit 从我的服务器 git 存储库下载/克隆一个新分支到我 PC 中已经创建的本地 git 存储库 - How to download/clone a new branch from my server git repository into an already created local git repository in my PC with Eclipse EGit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM