Back to Panel
Panel

How to Connect a Git Repository to Your Game Server

5 min read·Updated Nov 2, 2026

Learn how to link a GitHub, GitLab, or Gitea repository to your game server in the RiverHosting panel so you can keep your configs, plugins, and mods safely version-controlled.

If you make frequent changes to your server's config files, plugins, or mods, keeping those files in a Git repository is a great way to track every change, roll back mistakes, and share your setup across servers. The RiverHosting panel includes a built-in Git page that lets you connect your server directly to a GitHub, GitLab, Gitea, or Forgejo repository, with no command line needed.

This guide walks you through connecting a repository, choosing which files to sync, and pulling or pushing changes from the panel.

Before you start

  • You need an active game server on the RiverHosting panel.
  • You need an account on GitHub, GitLab, Codeberg, or a self-hosted Gitea or Forgejo instance.
  • If you plan to use an existing repository, make sure it is already created on your Git platform before starting.
  • If you are a subuser rather than the server owner, you need the Git permissions (Read, Pull, Push, and Manage) granted to your account by the owner.
No command line needed

You do not need to know Git commands, SSH keys, or terminal tools to use this feature. Everything is handled inside the RiverHosting panel.

1. Connect your Git account to the panel

Before you can link a repository to a server, you need to connect your Git account once. This connection works across every server you manage, so you only need to do this step one time.

  1. Log in to the RiverHosting panel.
  2. Click your account icon or name in the top corner to open your account settings.
  3. Go to the Git connections tab.
  4. Choose your platform:
    • Click Continue with GitHub to connect a GitHub account.
    • Click Continue with GitLab to connect a GitLab account.
    • Click Continue with Codeberg to connect a Codeberg account.
    • For a self-hosted Gitea, Forgejo, or GitLab instance, click Self-hosted Gitea, Forgejo or GitLab? Connect with an access token, choose the platform type, enter your server address, and paste an access token.
  5. Follow the prompts to authorise access. Once connected, your account will appear in the list with a status of Working.
Already connected?

If you have connected an account before, you can skip straight to step 2 and go to the Git page on your server.

2. Open the Git page on your server

  1. Open the server you want to link a repository to.
  2. In the left-hand menu, scroll to the SYSTEM section and click Git.

On the Git page, click Link a repository. You can either use an existing repository or create a brand new one.

Option A: Use an existing repository

  1. Select Use an existing repository.
  2. Choose the connected account to use.
  3. Search for and select the repository you want to link.
  4. Choose the branch you want to sync with.

Option B: Create a new repository

  1. Select Create a new repository.
  2. Enter a name and an optional description.
  3. Toggle Private on if you want the repository to be private. This is recommended for server configs that may contain passwords or keys.
Keep configs private

If your config files contain passwords, RCON tokens, or API keys, always use a private repository. The panel will flag files that look like they contain secrets before you push them.

After choosing or creating a repository, you will be asked for two more settings:

  • Server folder: The folder on your server to sync. Use / for the whole server, or a subfolder such as /plugins if you only want to track a specific area.
  • Auto-pull: When turned on, the panel automatically pulls the latest changes from the repository every time you push a new commit to it.
Start with a subfolder

If you are new to this, linking just /plugins or a config folder is a safer and simpler starting point than syncing your whole server.

4. Choose which files to sync

After linking, you will see a file tree called What to sync. This is one of the most important steps.

  • Ticked files are included in pulls and pushes.
  • Unticked files, such as world saves, logs, and the game itself, are never read, written, or deleted by Git.

The panel starts you with a preset for your game (for example, a Minecraft Java preset, a Valheim preset, and so on). You can adjust the selection to match exactly what you want to track.

When you are happy with the selection, click Save rules. These rules are saved as a .gitignore file in your repository the next time you push.

Linking does not move any files

Connecting a repository and saving your sync rules does not immediately copy or change any files on your server or in the repository. Nothing moves until you perform a pull or a push.

5. Pull files from the repository to your server

If your repository already contains files you want to bring onto the server, use the Pull button on the Git page.

  • Only ticked files are copied across.
  • Files that exist on the server but not in the repository are left alone.
  • If the same file has been changed both on the server and in the repository, the pull will stop and list the conflicts. You can push the server version first, untick the file, or choose Overwrite server changes to replace the server version with the repository version.

6. Push files from your server to the repository

To send your server's current files up to the repository, click Push.

  1. A preview will open showing new, changed, and deleted files.
  2. Enter a commit message. The default is Update from [your server name], but you can write anything that describes your changes.
  3. Click Push to send the commit.
Secrets flagged before pushing

If the panel detects a file that looks like it may contain passwords, tokens, or keys, it will flag it and require you to tick I understand, push these files anyway before the push goes through. Review these files carefully and consider excluding them from your sync rules.

Branch must be up to date

The Push button is blocked if the repository branch has changed since your last sync. Pull the latest changes first, then push.

From the Git page you can also:

  • Change the Branch or Server folder at any time from the settings card. Note that changing either of these resets the sync and starts it over.
  • Toggle Auto-pull on or off.
  • Click Unlink to stop syncing. Unlinking does not delete any files on your server or in your repository. It simply disconnects the two.

Troubleshooting

  • My connected account shows "Needs reconnecting". Go back to your account's Git connections tab and reconnect the account. Once it shows "Working" again, syncing will resume. On the Git page you will also see an option to relink with another connected account.
  • The Push button is greyed out. This usually means the repository branch has new commits that your server has not pulled yet. Click Pull first, resolve any conflicts, then try pushing again. It can also mean a file or the total push is over the size or file-count limit.
  • A pull stopped because of conflicts. You have three options: push your server version to the repository first, untick the conflicting file from your sync rules, or choose Overwrite server changes to replace the server file with the repository version.
  • Auto-pull is not triggering. Make sure Auto-pull is toggled on in the Git settings card. Auto-pull works by adding a webhook to your repository. If you deleted the webhook on your Git platform, unlinking and relinking the repository will recreate it.
  • I cannot see the Git page in the sidebar. If you are a subuser, ask the server owner to grant you the Git Read permission under the Users page.

Need help?

If you run into an issue that is not covered here, the RiverHosting support team is happy to help.

Contact support

Visit riverhosting.com/support to open a ticket or start a live chat. Share what you were trying to do and any error messages you saw so the team can assist you quickly.

Similar Articles