'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.
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
It says:
- https://console.developers.google.com
- Left panel > source code > releases
- Click the link "Configure your repository" in the first paragraph
- In the second sentence, click the little help icon w/ a ?
- Click the link "generate your git credentials"
On Step 2 there is no "source code/releases" option
And If I try to go on Step 4 "Git Credentials", in credentials only have API Credentials, not Git.
Solution 1:[1]
Recomended way (with gcloud credentials)
I found a workaround to get it work (macOS):
cd myproject
git config credential.helper gcloud.sh
You must be authenticated in your local gcloud
CLI and have it in your $PATH
.
Then start SourceTree through the Terminal:
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.
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:
<?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
- Rename SourceTree.app to SourceTree2.app
- Rename SourceTree2.app to SourceTree.app
You are done, SourceTree should now be able to use the gcloud credentials.
With password:
Solution 2:[2]
Nowadays, it's easy to do so. I am on Microsoft Windows 11 OS machine.
Firstly, follow these instructions on creating a repository on Google Cloud (gcloud) Repositories:
- https://cloud.google.com/source-repositories/docs/create-code-repository
- 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.
On SourceTree, navigate to the "Add" option, in order to browse to just cloned repository on your local machine.
And you are ready to go! You can commit the code on your Google Cloud Repositories.
Best regards
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | ucas |