ElBlo
My idx github Setup
Writing down the steps to get github repo access in Google IDX.
I created a fine-grained personal access token (PAT), for each private repository, with only “Content” read-write access.
Then I cloned the repository via https, using the token as the github password.
Finally, I ran git config credential.helper store
to set up the credential helper in the repo, and ran git pull
, again using the PAT as the github password.
Subsequent operations will use the same credentials.
Why?
It seems like by default, idx requests access to your entire account and all your repos. This way at least, you are only giving access to one repo at a time.
Resetting the token
After your token expired, you will need to reset the credentials. Run git config --unset credential.helper
to clear the old credentials.
Multiple PATs
If you want to have multiple repositories, each of them with its own fine-grained personal access token, you can use git config credential.useHttpPath true
to make the credential helper keep track of the https path (that way, each repository will use only the token associated with it).