Connect a Git repository
Add a GitHub, Bitbucket or Azure DevOps repository with a read-only token so MetaLens360 can correlate deployed metadata with commits and branches.
Overview
Connecting your source repository lets MetaLens360 read commits and branches and link them to what is actually deployed in your orgs. It powers repository insights, branch comparisons and the promotion pipeline. MetaLens360 only reads the repository — read-only access is enough, and it never writes to it.
Before you start
- You need the Manage org/Git connections permission (Admin, Architect and DevOps roles by default).
- Create a token with read access for your provider:
- GitHub classic token: the
reposcope. Fine-grained token: set Resource owner to the organization that owns the repository (not your personal account), with Contents and Pull requests set to Read-only. - Bitbucket app password: "Repositories: Read".
- Azure DevOps personal access token: "Code (Read)".
- GitHub classic token: the
- If your GitHub organization uses SAML SSO, authorize the token for it: on GitHub's token page click Configure SSO → Authorize next to the token.
Steps
- Open Connections and click Add Git Repo. The Add Git Repository Connection dialog opens with three steps: Repository, Access, Confirm.
- In Repository URL, paste the repository's web address, for example
https://github.com/acme/salesforce-core. MetaLens360 fills in Provider, Owner / Org and Repository Name for you. Check them. - Enter a Display Name — how the repository appears in MetaLens360 — and click Continue.
- Paste your token into Personal Access Token.
- For GitHub, click Verify access (or Continue, which runs the same check). A Connection check list shows each check with a fix for anything that failed. Nothing is saved until every check passes.
- On the Confirm step, pick the Default Branch — the branch MetaLens360 reads by default. If no branch list was returned, type the branch name.
- Click Add Repository. The repository appears on the Git Repositories tab.
- Click Test on the repository row. You should see "Connected! N branches found."
Example
Ravi, a DevOps engineer, connects acme/salesforce-core. He creates a fine-grained token with Resource owner set to the acme organization and Contents + Pull requests read-only. The Connection check flags SSO, so he clicks Authorise for acme →, approves it on GitHub, presses Verify access again, picks main as the default branch and clicks Add Repository.
FAQs
Can I change the token later?
Yes. Click the edit icon on the repository and enter a new value in New Token (leave blank to keep existing), then Save Changes.
Who can test a repository connection?
Anyone with the Test connections permission (connections.test) — every role except Viewer by default.
Does MetaLens360 need write access?
No. Read access to contents (and pull requests on GitHub) is all it uses.
Troubleshooting
GitHub says the repository is "404 not found" but the name is right
This is almost always SAML SSO. The token must be authorized for the organization. Use Configure SSO → Authorize on GitHub, then verify again.
"Could not read an owner and repository from that URL — fill them in below."
The URL wasn't in a recognized format. Type the Owner / Org and Repository Name fields yourself.
A fine-grained token can't see the repository
Its resource owner is probably your personal account. Create a new token with the organization as the resource owner.
For more fixes, see Fix Git repository access.
Related articles
Was this article helpful?
Related articles
- Fix Git repository accessResolve errors when MetaLens360 can't list branches or read commits from a connected repository — expired tokens, missing scopes, SSO authorization and wrong owner names.
- Explore repository activity insightsActivity Overview shows who changed what in your Salesforce repository, which components change most, and where knowledge or test coverage is thin.
- Set up a promotion pipelineDescribe how code moves through your branches and Salesforce environments so MetaLens360 can track where every change has reached and what is stuck.
- Connect a Salesforce orgAdd a Salesforce org to MetaLens360 from the Connections page using an SFDX Auth URL, an access token or one-click Salesforce sign-in, then test it.