git client for google cloud repository

3,891 views
Skip to first unread message

Without Your Space Helmet

unread,
May 22, 2016, 3:26:36 AM5/22/16
to Google Cloud Developers
Hi,

I'm learning about google cloud source repositories:


I have successfully created a git repository on my computer and pushed it to my private google cloud repository.

I then tried to clone my gcloud repo using github desktop, but I kept getting an authentication error when I entered my username and password.

Does anyone know of a git client gui that is compatible with cloud.google.com/source-repositories?

thanks

Jesse Scherer

unread,
May 23, 2016, 2:22:26 PM5/23/16
to Google Cloud Developers
Greetings from Cloud Support!

I'll ask around, but the first thing that jumps to mind as a possible issue is two-factor authentication. Do you have your account configured to require a code (from a text message or authenticator app)? That might confuse Github Desktop.

Regards,
Jesse

Chris Sells

unread,
May 23, 2016, 5:29:59 PM5/23/16
to Google Cloud Developers
Hey, Without (do you mind if I call you Without?). You've found a fairly under-documented part of our CSR offering. While we update the docs, please let me know if these steps unblock you:

If you’d like to use a GUI client, like GitHub Desktop, you have to do a little more work to get manually-generated credentials and then to use them with your GUI of choice. To get manually-generated credentials, do the following:


1. Go to the "Development" section in the Cloud Console.


2. Open the repository dropdown and select "Clone Repository":


3. Change the authentication mode to "Manually generated credentials":


4. Click "Generate and store your credentials":


The trick here is to actually click on the “Generate and store your Git credentials”, since that’s the magic where you get your credentials for use in your local GUI clients. If you press OK, then the dialog goes away and you have to start over again.


5. Gather the Git password (which goes along with the email you used to authenticate) presented when you click the link. You don’t need to populate the .netrc file when using GUI clients, since they’ll ask you for your username/password pair directly (as you’ll soon see).

GitHub Desktop (and other GUI clients)

Now you have your git username and password. With that, you have the credentials you need to use the repo from GitHub Desktop, but you still need to use some tricks to get GitHub Desktop to use your repo, since it isn’t hosted on GitHub:


1. At the command line, use “gcloud init” to set up the GCS credentials locally on your machine and “gcloud source repos clone <repo-name>” to bring the <repo-name> repo down as described here.


2. Start GitHub Desktop, press the + button in the upper left and choose to add the repo from your local disk:



3. When you have a local commit to this repo that you’d like to push, GitHub Desktop will know that it’s going to Cloud Source Repositories, but it’s not going to know the credentials, so this is when you use the git credentials you manually generated earlier:

Inline image 1


The user name is the email address you used to generate the Git password from step #5 above.


With your manually-generated Git credentials, you’ve got the username/password pair that your GUI clients can use to connect to Cloud Source Repositories. The above shows how to do this for GitHub Desktop, but the same trick should work from popular IDEs like Eclipse, Visual Studio, etc.

Without Your Space Helmet

unread,
May 24, 2016, 1:02:28 AM5/24/16
to Chris Sells, Google Cloud Developers
Yes, you may call me "Without". ;)
Thanks for the detailed step by step instructions. I'll let you know if that works.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-dev/cWUjNAUIiJ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-dev/921c492a-2aaf-439f-8f38-f96247574333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Without Your Space Helmet

unread,
May 27, 2016, 1:39:40 AM5/27/16
to Chris Sells, Google Cloud Developers
Hi Chris, I gave your instructions a try, and it appears to work! Much thanks!

Chris Sells

unread,
May 27, 2016, 6:28:05 AM5/27/16
to Without Your Space Helmet, Google Cloud Developers

Glad to hear it. Keep those cards and letters coming.

Without Your Space Helmet

unread,
Jun 4, 2016, 2:31:29 AM6/4/16
to Chris Sells, Google Cloud Developers
will do.
fyi, I'm using eclipse and egit to push to my Google Cloud Source Repository.
Appears to be working quite well.
thanks

On Fri, May 27, 2016 at 5:28 AM, Chris Sells <cse...@google.com> wrote:
>
> Glad to hear it. Keep those cards and letters coming.
>
>
> On May 26, 2016 10:39 PM, "Without Your Space Helmet" <withoutyour...@gmail.com> wrote:
>>
>> Hi Chris, I gave your instructions a try, and it appears to work! Much thanks!
>>
>>
>> On Mon, May 23, 2016 at 10:02 PM Without Your Space Helmet <withoutyour...@gmail.com> wrote:
>>>
>>> Yes, you may call me "Without". ;)
>>> Thanks for the detailed step by step instructions. I'll let you know if that works.
>>>
>>>
>>> On Mon, May 23, 2016 at 2:30 PM 'Chris Sells' via Google Cloud Developers <google-c...@googlegroups.com> wrote:
>>>>
>>>> Hey, Without (do you mind if I call you Without?). You've found a fairly under-documented part of our CSR offering. While we update the docs, please let me know if these steps unblock you:
>>>>
>>>> If you’d like to use a GUI client, like GitHub Desktop, you have to do a little more work to get manually-generated credentials and then to use them with your GUI of choice. To get manually-generated credentials, do the following:
>>>>
>>>>
>>>> 1. Go to the "Development" section in the Cloud Console.
>>>>
>>>>
>>>> 2. Open the repository dropdown and select "Clone Repository":
>>>>
>>>>
>>>> 3. Change the authentication mode to "Manually generated credentials":
>>>>
>>>>
>>>> 4. Click "Generate and store your credentials":
>>>>
>>>>
>>>> The trick here is to actually click on the “Generate and store your Git credentials”, since that’s the magic where you get your credentials for use in your local GUI clients. If you press OK, then the dialog goes away and you have to start over again.
>>>>
>>>>
>>>> 5. Gather the Git password (which goes along with the email you used to authenticate) presented when you click the link. You don’t need to populate the .netrc file when using GUI clients, since they’ll ask you for your username/password pair directly (as you’ll soon see).
>>>>
>>>> GitHub Desktop (and other GUI clients)
>>>>
>>>> Now you have your git username and password. With that, you have the credentials you need to use the repo from GitHub Desktop, but you still need to use some tricks to get GitHub Desktop to use your repo, since it isn’t hosted on GitHub:
>>>>
>>>>
>>>> 1. At the command line, use “gcloud init” to set up the GCS credentials locally on your machine and “gcloud source repos clone <repo-name>” to bring the <repo-name> repo down as described here.
>>>>
>>>>
>>>> 2. Start GitHub Desktop, press the + button in the upper left and choose to add the repo from your local disk:
>>>>
>>>>
>>>>
>>>> 3. When you have a local commit to this repo that you’d like to push, GitHub Desktop will know that it’s going to Cloud Source Repositories, but it’s not going to know the credentials, so this is when you use the git credentials you manually generated earlier:
>>>>
>>>>
>>>>

Chris Sells

unread,
Jun 5, 2016, 11:06:04 AM6/5/16
to Without Your Space Helmet, Google Cloud Developers
That's good news.
Reply all
Reply to author
Forward
0 new messages