MetaLens360Help Center

Fix Git repository access

Resolve errors when MetaLens360 can't list branches or read commits from a connected repository — expired tokens, missing scopes, SSO authorization and wrong owner names.

Updated in Troubleshooting

Overview

MetaLens360 reads your repository with the personal access token (or app password) saved on the connection. When that token stops working, repository pages and branch pickers show errors such as:

  • "No branches could be listed for this repository. Check the connection under Connections → Git."
  • "Sync failed. Check the repository connection and its token."
  • "Could not read commits from that repository (HTTP 401)." (or another status code)
  • "No branches cached. Click refresh to fetch from GitHub." or "Could not fetch branches" when starting a comparison.
  • "No Git repository is connected to this workspace yet." — nothing is connected; see Connect a Git repository.

Almost every case comes down to one of five causes: the token expired or was revoked, it lacks a scope, it isn't authorized for SSO, the owner or repository name is wrong, or a fine-grained token belongs to the wrong resource owner.

Before you start

  • Editing a connection needs the Manage org/Git connections permission (Admin, Architect and DevOps by default). Testing needs Test connections (every role except Viewer).
  • Have access to your Git provider's token settings, or ask the token owner.

Steps

  1. Open Connections and select the Git Repositories tab.
  2. Click Test on the repository. "Connected! N branches found." means access is fine — the problem is elsewhere. Any other message tells you why.
  3. Check the token on your Git provider:
    • Not expired or revoked.
    • GitHub classic token has the repo scope; a fine-grained token has Resource owner set to the organization, with Contents and Pull requests read-only.
    • Bitbucket app password has "Repositories: Read"; Azure DevOps token has "Code (Read)".
    • For a GitHub organization with SAML SSO, the token is authorized: Configure SSO → Authorize.
  4. If you need a new token, create it, then click the edit icon on the repository and paste it into New Token (leave blank to keep existing).
  5. Confirm Owner / Org and Repository Name match the repository exactly, then click Save Changes.
  6. Click Test again, then retry the page that failed.

Example

Source Code Repo Insights for acme/salesforce-core shows "Could not read commits from that repository (HTTP 404)." Ravi tests the connection and gets the same 404, even though the name is right. The acme organization enabled SAML SSO last week, so he authorizes his token for SSO on GitHub. Test now shows "Connected! 42 branches found."

FAQs

Why does GitHub say 404 for a repository I can see?

GitHub returns 404, not 403, when a token can't access a private repository — including when SSO authorization is missing. Treat a 404 as an access problem first.

My fine-grained token works for my repos but not the team's

Fine-grained tokens are tied to one resource owner. Create one with the organization as resource owner; the organization may also need to approve it.

Does MetaLens360 need write access?

No. Read-only is enough; MetaLens360 never writes to your repository.

Troubleshooting

"Could not load branches with the stored token — type a name, or update the token below."

Shown in the edit dialog: the saved token can't list branches. Paste a new token, or type the default branch by hand.

Bitbucket or Azure DevOps repositories weren't verified

The in-dialog access check supports GitHub only. Use Test after saving.

Scheduled repository fetches show Failed

Check Repo Fetch Status on Check sync and fetch status for the error, then fix the token as above.

Was this article helpful?

Related articles