簡體   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