Only show guides for your app
Link a repository on your server's Git page, deploy it, read the log and roll back, with what each tab of the page does and what your plan allows.
The Git page links a repository to your server and copies its files onto the server each time you deploy. You'll find Git in your server's menu, under Application on app servers and under Advanced on the others.
The bar at the top names the linked repository, marks it Public or Private, and shows its deploy state: Not deployed yet, Up to date, a count such as 3 commits behind, or Out of sync when the live commit isn't on the branch. Its buttons refresh the page, open the repository on its provider and deploy. The deploy button reads Deploy now before the first deploy, Deploy latest when the server is behind and Redeploy when it's up to date. With more than one repository linked, click the name to switch between them.
| Tab | What it's for |
|---|---|
| Code | Browses the files on any branch or tag. Set as deploy branch makes the branch you're browsing the one that deploys |
| History | Lists the branch's commits. Open one to see its changes or press Deploy this commit |
| Deployments | Lists every deploy with its status, and shows the log of the one you pick |
| Builds | Lists image builds, for a server that builds its repository's Dockerfile |
| Connection | Shows the linked repository, its webhook, your Provider accounts and the Deploy key |
| Settings | Holds the branch, what happens after a deploy, which files deploy and the auto-deploy rules |
On a phone, the bar at the bottom shows Code, History and Deploys, and Menu holds the rest. Until a repository is linked, only Connection is there.
Mia keeps her Discord bot in mia/welcome-bot on GitHub.
main.The window also has an Auto-deploy switch, which needs Premium. Auto-deploy on push covers it.
To add another repository, click the repository name and choose Link another repository. Each extra one deploys into its own folder, which you name in Deploy into. To use a GitLab or Gitea server you host yourself, open Connection, press Add beside Add a server under Provider accounts, and enter its address and a personal access token.
If files on the server changed since the last deploy, the window warns you and lists them, because the deploy may overwrite them.
A deploy copies the repository into /home/container, or into the folder set in Deploy into, and overwrites server files that have the same name. Files the repository doesn't have stay where they are, which is why Mia's .env and her bot's data survive every deploy.
The Files on the server card on the Settings tab changes that. All four switches start off.
| Switch | What it does |
|---|---|
| Remove deleted files | Files deleted from the repository are deleted from the server too. Excluded paths are never touched |
| Stop the server while copying | Stops the server for the copy and starts it again afterwards, for deploys that don't restart it |
| Include submodules | Clones the repository's submodules when they're on the same host |
| Download Git LFS files | Fetches large files stored with Git LFS instead of their pointers |
Sync paths and Excluded paths limit which paths deploy, up to 20 each (Deploy one folder of a monorepo). Post-deploy commands and Post-deploy schedules run after the copy (Build steps on deploy). The tab saves each change as you make it.
Post-deploy action starts at None, which means the server keeps running the old code until it restarts. Mia sets it to Restart server, and her bot comes back on the new code after each deploy.
On Deployments, pick a deploy that succeeded and press Roll back. Falix deploys that commit again. You can also open a commit on History and press Deploy this commit.
Free and Premium servers both get the whole Git page: linking, deploying by hand, rolling back and scheduled pulls of a public repository. Turning on Auto-deploy, which deploys every push, needs a Premium server.
| What you see | Usual cause | Fix |
|---|---|---|
| The deploy fails to find the branch | The branch was renamed or deleted | Pick one that exists under Branch on the Settings tab |
| A private repository won't link from a URL | From URL reaches public repositories only | Link it From account (Deploying from private repositories) |
| The deploy worked, but the old code still runs | Post-deploy action is None | Set it to Restart server, or restart the server |
| The server won't start after the first deploy | The entry file isn't where the application looks for it | When your server won't start |
Your .env was overwritten |
The repository has a file named .env |
Remove it from the repository (Keep secrets out of Git) |
| "Another repository already deploys into this folder" | Two repositories can't share a folder | Pick another folder in Deploy into |
When a Git deploy fails goes through the deployment log in more detail.