Git Integrations
Connect Git providers, configure access tokens/keys, and enable repository-based deployments.
Git integrations let tug.sh deploy from repositories and react to commits.
What you need
Before connecting a provider, prepare one of:
- a personal access token (PAT),
- an app/repo token,
- or an SSH deploy key flow (when required by your provider/policy).
Use least-privilege scope whenever possible (read repository content and webhook management if needed).
Connect a provider
- Open Settings -> Git Integrations.
- Choose your provider (for example GitHub or GitLab).
- Add credentials (token or integration secret).
- Save and test connection.
After a successful connection, repositories become selectable in deploy workflows.
Configure repository deployment
- Open deployment flow for target project/container.
- Select Git source and repository.
- Choose branch and build/deploy strategy (
Dockerfileordocker-compose.yml). - Save deploy configuration.
Webhook setup
tug.sh provides a webhook URL per repository configuration.
Recommended steps:
- Copy webhook URL from Git deployment settings.
- Add webhook in your Git provider repository settings.
- Set the provider webhook secret/token and store the same secret in tug.sh when requested.
- Trigger a test delivery from the provider panel.
On each commit push, the provider sends an event to tug.sh, and tug.sh dispatches deploy command to the correct VPS Agent.
Token and key hygiene
- Rotate tokens periodically.
- Revoke unused tokens immediately.
- Use separate credentials for production and staging repos.
- Prefer repository-scoped tokens over broad account-wide tokens.
- Never hardcode tokens in compose files or container images.
Troubleshooting
If deployment does not trigger:
- verify webhook URL and secret match,
- check repository access scope on the token,
- confirm branch name in deployment settings,
- review deployment logs in the dashboard for the exact failure step.