For clarity on multiple posts in this forum like below creating a topic on the real issue.
AI Studio can only sync to a private account’s repositories, not to an organzation’s repositories.
Steps to reproduce:
Make sure your AI Studio account is not linked to any github account.
Click the Save to Github button in AI Studio
In the popup you will see a treeview with your personal account and the organization you are admin of
Select the organization
Select “access to all repositories”. I assume you need rights to the root of the organization in order to create a new repository for that org.
A button “On Main“ show on the top not clear what it does.
Click “Create Git Repo“
The error shows “Failed to create GitHub repository, Insufficient permissions to create the GitHub repository. Please check your permissions for the AI Studio App on GitHub“.
I have tried uninstalling the AI Studio app from both personal and org accounts, re install, nothing helps.
For example, I am able to link my org account to Firebase Studio.
I used this little hack to make it work for me: (BUG connecting GitHub ORG to AI Studio)
Disconnect AI Studio from your GitHub account
Settings > Applications
In both tabs click Uninstall (Installed and Authorized)
Go back to the AI Studio project
No need to create a new one or clear cache, but for safety you can try
Reconnect AI Studio to your personal GitHub account (not the org) and create a new project there
Transfer the project ownership to the ORG and return to AI Studio
It will show an error because the project no longer exists in the same location
But if you click the project URL shown at the top of the tab, it will take you to the project inside the ORG
Remove AI Studio from your GitHub account again
Repeat step 1 and uninstall in both places
Refresh AI Studio without cache and connect to GitHub again
This time connect using the ORG
It should find the project and from now on sync automatically
It’s not been fixed. After disconnecting it just creates a new repository in my private account. Also, I can only create a new repository and not commit to an existing one.
To create a new repository under your GitHub Organization instead of your personal account, uninstall the Google AI Studio app from your personal GitHub account as described in Reviewing and modifying installed GitHub Apps so the app remains installed only on your GitHub Organization (uninstalling the app only removes the app installation and does not delete or modify your existing repositories), then create the repository again from Google AI Studio.
To sync and commit with an existing GitHub repository, import that repository into a new project as described in Build apps in Google AI Studio, then open Sync to GitHub and select More options to link and sync with that repository.