简体   繁体   English

如何在 Source Tree 上使用 Google Cloud?

[英]How use Google Cloud on Source Tree?

I just created a new Repo in Google Cloud and wanna use the Source Tree app as controllers for my git interactions.我刚刚在 Google Cloud 中创建了一个新的 Repo,并想使用 Source Tree 应用程序作为我的 git 交互的控制器。

But I keep been asked this password for push.但我一直被问到这个推送密码。 在此处输入图像描述

Is no my Google account password I already setup the 2-verification password, but still not able to create this password.没有我的谷歌帐户密码 我已经设置了二次验证密码,但仍然无法创建此密码。

EDIT: If I try to follow this guide Set Up a Google Cloud Git Repo In SourceTree编辑:如果我尝试按照本指南设置 Google Cloud Git Repo In SourceTree

It says:它说:

  1. https://console.developers.google.com https://console.developers.google.com
  2. Left panel > source code > releases左面板 > 源代码 > 发布
  3. Click the link "Configure your repository" in the first paragraph单击第一段中的“配置您的存储库”链接
  4. In the second sentence, click the little help icon w/ a?在第二句话中,单击小帮助图标 w/ a?
  5. Click the link "generate your git credentials"单击链接“生成您的 git 凭据”

On Step 2 there is no " source code/releases " option第 2 步中没有“源代码/发布”选项在此处输入图像描述 在此处输入图像描述

And If I try to go on Step 4 " Git Credentials ", in credentials only have API Credentials, not Git.如果我在第 4 步尝试 go“ Git 凭据”,凭据中只有 API 凭据,而不是 Git。 在此处输入图像描述

Recomended way (with gcloud credentials) 推荐方式(使用gcloud凭证)

I found a workaround to get it work (macOS): 我找到了一个解决方法来实现它(macOS):

 cd myproject git config credential.helper gcloud.sh 

You must be authenticated in your local gcloud CLI and have it in your $PATH . 您必须在本地gcloud CLI中进行身份验证,并将其保存在$PATH Then start SourceTree through the Terminal: 然后通过终端启动SourceTree:

 open /Applications/SourceTree.app/Contents/MacOS/SourceTree 

This will propagate your $PATH to SourceTree in order to make the script git-credentials-gcloud.sh available. 这会将$PATH传播到SourceTree,以使脚本git-credentials-gcloud.sh可用。

I managed to find a solution that does not involved the Terminal. 我设法找到了一个不涉及终端的解决方案。 You should add the following in the Info.plist of the SourceTree.app package ( /Applications/SourceTree.app/Contents/Info.plist ), at the end of the main <dict> item: 您应该在主<dict>项的末尾的SourceTree.app包的Info.plist中添加以下内容( /Applications/SourceTree.app/Contents/Info.plist ):

 <?xml version="1.0" encoding="UTF-8"?> <plist ..... <dict> ... ... <key>LSEnvironment</key> <dict> <key>PATH</key><string>CONTENT OF YOUR $PATH</string> </dict> </dict> 

Then you need to flush the macOS cache by 然后你需要刷新macOS缓存

  • Rename SourceTree.app to SourceTree2.app 将SourceTree.app重命名为SourceTree2.app
  • Rename SourceTree2.app to SourceTree.app 将SourceTree2.app重命名为SourceTree.app

You are done, SourceTree should now be able to use the gcloud credentials. 您已完成,SourceTree现在应该能够使用gcloud凭据。

With password : 使用密码

Browse https://source.developers.google.com/auth/start?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform 浏览https://source.developers.google.com/auth/start?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform

Nowadays, it's easy to do so.如今,这样做很容易。 I am on Microsoft Windows 11 OS machine.我在 Microsoft Windows 11 OS 机器上。

Firstly, follow these instructions on creating a repository on Google Cloud (gcloud) Repositories:首先,按照以下说明在 Google Cloud (gcloud) Repositories 上创建存储库:

  1. https://cloud.google.com/source-repositories/docs/create-code-repository https://cloud.google.com/source-repositories/docs/create-code-repository
  2. Clone the remote repository-- on Google Cloud-- to your local machine (the way to do it explained under that tutorial)将远程存储库——在谷歌云上——克隆到你的本地机器(在该教程中解释了如何做)

Then, install the SourceTree, if you do not have one.然后,安装 SourceTree,如果你没有的话。

在此处输入图像描述

On SourceTree, navigate to the "Add" option, in order to browse to just cloned repository on your local machine.在 SourceTree 上,导航到“添加”选项,以便浏览到本地计算机上刚刚克隆的存储库。

And you are ready to go. You can commit the code on your Google Cloud Repositories.您已准备好拨打 go。您可以在 Google 云存储库上提交代码。

Best regards最好的祝福

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

相关问题 TortoiseGit可以使用Google Cloud Source资源库吗? - Can TortoiseGit use a repository of Google Cloud Source repositories? 如何使用sdk对Google Cloud Source Repositorys正确进行身份验证 - how to authenticate correctly to Google Cloud Source Repositoriess with sdk 如何在Eclipse中使用Google Cloud Repository? - How to use Google Cloud Repositories with Eclipse? 如何从Google Cloud Source存储库直接部署到Google App Engine? - How can I deploy direct from Google Cloud Source Repository to Google App Engine? 重命名Google Cloud Source存储库中的Git存储库 - Rename Git repository in Google Cloud Source Repositories 无法将提交推送到 Google Cloud Source Repositories - Unable to push the commits to Google Cloud Source Repositories Google Cloud Platform:集成 Cloud Source Repository 和 ReadTheDocs - Google Cloud Platform: Integrating Cloud Source Repository and ReadTheDocs 使用 Cloud Source 存储库设置 Google Cloud Function 时出现 ModuleNotFoundError - ModuleNotFoundError when setting up Google Cloud Function with Cloud Source repository 如何从谷歌云源中的私有仓库运行安装 pip 要求? - How to run install pip requirements from private repo in google cloud source? 在Google Cloud Source Repository(CSR)中进行编辑/提交后如何测试和部署? - How to test and deploy after edit/commit in Google Cloud Source Repositories (CSR)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM