Hangar reads your code from the Git host where it already lives. You connect the host once, in Settings → Git providers, and every project in the organization can then pick repositories and branches from it.
GitHub
Connecting GitHub installs the Hangar GitHub App on your account or on a GitHub organization. GitHub asks which repositories the app may access: all of them, or only the ones you select. Hangar only sees those.
To change the list later, open the provider in Hangar and follow the link to manage repository access on GitHub.
If you install the app on a GitHub organization you do not own, an owner of that organization has to approve it before it shows up in Hangar.
GitLab and Bitbucket
For GitLab.com and Bitbucket Cloud, Hangar sends you to the host to authorize access, and the provider is created when you come back. There is nothing to copy or paste.
Self-managed GitLab and Gitea
A GitLab instance you run yourself, or a Gitea server, does not know Hangar's application, so you register one on it:
- On your instance, create an OAuth application and use the redirect URI Hangar shows you.
- In Hangar, enter the instance URL with the application's client ID and secret.
For GitLab you can also limit the provider to some groups.
Sharing with your team
A provider belongs to the person who connected it. You can share it with the whole organization, so every member can deploy from those repositories without connecting their own account. Deleting a shared provider removes access for everyone.
Public repositories
A public repository does not need a provider: choose Git as the source and paste its URL. Hangar does not hear about pushes to a host it is not connected to; to deploy on push, add the service's deploy hook as a push webhook in the repository's settings, so the event and its branch reach Hangar.
What a connected repository gives you
- Deploys on every push to the branch you chose, or only when you publish a tag. See Builds.
- Watch paths, so a service in a monorepo only deploys when its own files change.
- Preview deployments for pull requests, on GitHub.