Lightning Studio : Git clone organization repository does not work

Hi,

I am trying out Lightning Studio for a school project but I cannot get git clone to work using the vscode github integration.

We created an organization for the project and we have 1 repository for the project.

I made sure to grant access to the organization (we use organization as a way to create a repository for this specific course).

What I’ve tried :

  1. Using the command palette, do a git clone and select the repository from the dropdown
  2. VSCode attempts to clone it and when I click “open” or “add to workspace” from the pop-up, the page refreshes but my file explorer is left with an empty folder with the name of the repository.
    I noticed that there is an exclamation mark next to the folder name, see :
    this screenshot

Extra information :
I noticed that when trying to use the terminal to manually do a git clone I keep getting an error saying I need to make sure I granted permission to the organization but as you can see in the photo, I have.
SSH

git clone [email protected]:GIF-7005-Projet/cloud-cover-detection.git
Cloning into 'cloud-cover-detection'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/GIF-7005-Projet/cloud-cover-detection.git/'


To fix this issue:
1. Verify the repository name for accuracy and retry.
2. Grant access to the Lightning-GitHub integration for organization repositories at:
   https://github.com/settings/connections/applications/c7457225b242a94d60c6

HTTPS

git clone https://github.com/GIF-7005-Projet/cloud-cover-detection.git   Cloning into 'cloud-cover-detection'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/GIF-7005-Projet/cloud-cover-detection.git/'


To fix this issue:
1. Verify the repository name for accuracy and retry.
2. Grant access to the Lightning-GitHub integration for organization repositories at:
   https://github.com/settings/connections/applications/c7457225b242a94d60c6

When I do git config --list my information is there (right username and email for my github user).

I can provide further information if needed, thanks for your support!

After further investigation, it looks like creating a new Team Space fixed the issue!
It was probably my fault I was using the default one the is created when you first try Lightning Studio.
Would be nice to warn the issue that the default team space is for demo purposes only.
Cheers!

I’m glad you found a way to get it working and I’ve forwarded this to the team to take a look.
Thanks!

1 Like

@alexandrebrown1 glad you’ve got it working now. I also tried cloning from the GitHub extension’s command; it first gave me a strange “User did not consent to login” error, but worked the second time. Since its an extension, it isn’t automatically authenticated by Studios.

git clone or gh repo clone should always work once you’ve connected your GitHub to Lightning AI Studios. To do this:

  1. Go to Global settings on the top right

  2. Click on Integrations and sign in to GitHub

  3. Any studios you re/start after this will be authenticated to your GitHub, and you should be able to run git clone or gh repo clone reliably

We’re also experimenting with a more intuitive way of doing this from within the Studio in upcoming releases - more on that as it develops :slight_smile:

Hi @angad , thanks for the detailed information.
In my case I had already signed in to Github to enable the integration (this is what my first screentshot shows).
I would say that you guys did an amazing job with the Github integration, the setup is easy and straightforward.
Not certain where the issue was but I can say that I also tried revoking the access/integration and re-doing it and it would show that my integration was setup correctly but the git clone would keep failing regardless.

I only got it to work after creating a new teamspace.
A bad state from the teamsapce? Or is the default teamspace read-only/demo-only? Not sure.

Hope this helps!

This is very helpful, thanks for clarifying!

Hmm, it should also work in the default teamspace. If you enabled the integration from settings, you’d currently have to restart your studio manually for GitHub to be authenticated. Do you see a logged-in status when you run gh auth status from the default teamspace now, and does git clone from the CLI still fail?