Git Deploy

Revision as of 16:10, 19 November 2026 by Wikiadmin (talk | contribs) (Created page with "Git Deploy lets you publish website files from a local Git repository to your Bravenet web hosting account. Push your committed HTML, CSS, JavaScript, images, and PHP files directly to your website without uploading them individually through SFTP or the File Manager. There is no build step on the server. If your project uses a build tool, build it on your computer or in your own workflow, then commit the files you want visitors to receive. The root of the deploy branch...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Git Deploy lets you publish website files from a local Git repository to your Bravenet web hosting account. Push your committed HTML, CSS, JavaScript, images, and PHP files directly to your website without uploading them individually through SFTP or the File Manager.

There is no build step on the server. If your project uses a build tool, build it on your computer or in your own workflow, then commit the files you want visitors to receive. The root of the deploy branch should contain your website's ready-to-publish files.

Before you begin

You will need:

  • An eligible paid web hosting package with SSH access. Git Deploy is not available with email-only hosting.
  • A website in your Bravenet hosting account.
  • An active SSH account. If you do not have one, open SSH Manager and create it first. You can optionally add an SSH public key to avoid entering your SSH password on every push.
  • Git installed on your computer and a local repository containing your website files.
  • Enough available storage for your live website, Git repository and history, and deployment working files.

Important: Git Deploy manages the contents of your website root. Files removed from the deploy branch are removed from the live website on the next successful deployment. Changes made through SFTP, the File Manager, or a website application may also be overwritten or removed by the next deployment. Keep the files you want to publish in your local repository, and maintain separate backups.

Do not commit passwords, private keys, database backups, or other private files into the content you publish. Files in the deploy branch are copied into the website root.

Enable Git Deploy

  1. Sign in to your Bravenet account and open Web Hosting.
  2. Open the website you want to publish and select Git Deploy in its management tools.
  3. If prompted, open SSH Manager, create an active SSH account, and return to Git Deploy.
  4. Back up any existing website files before removing them. Include hidden files such as .htaccess. See Backing up your Hosting Websites and Databases.
  5. Empty the website root using SFTP or the File Manager. New websites may already contain starter files, which must also be removed. Bravenet does not automatically delete these files when you enable Git.
  6. If you have more than one active SSH account, choose the account you want to use for this website.
  7. Click Enable Git.

Enabling Git resets the document root to the website root. Git deploys to that folder, rather than to a previously configured subfolder such as wordpress. If your website uses a custom document root, prepare your repository for this change before enabling Git.

Once Git is enabled, the page displays your website's remote URL and the commands to connect your local repository. Each website has its own repository; copy the URL from the correct website's Git Deploy page.

Publish your website

Open a terminal in your local website repository. Make sure the files you want to publish have been committed.

Add the remote using the URL shown on your Git Deploy page:

git remote add bravehost YOUR_REMOTE_URL

Replace YOUR_REMOTE_URL with the complete URL from the page. Use the supplied SSH username, server, port if shown, and repository path. Your local remote name in these examples is bravehost.

For a newly enabled website, publish your current local commit to the remote's main branch:

git push bravehost HEAD:main

HEAD:main publishes your current local commit to the remote main branch, even if your local branch has a different name. If the page shows a different deploy branch, use the exact push command provided there.

Read the remote messages in your terminal. Successful publication reports Deployed followed by the commit identifier. Return to Git Deploy to check Last deploy and visit your website to verify the result.

Publish later changes

Edit your files locally, review your changes, and commit the files you want to publish. For example:

git add index.html
git commit -m "Update the home page"
git push bravehost HEAD:main

Replace index.html with the files you changed. Uncommitted files and ignored files are not included in a push.

Only the configured deploy branch is accepted by this remote. Pushing other branches or tags, or deleting the deploy branch, is rejected. Submodules are not supported; include the actual files your website needs in the deploy branch.

Deployment settings and history

Click the settings gear beside your website's repository to open Git settings.

Option What it does
Redeploy Publishes the current remote deploy branch again without a new push. Use this after resolving a publication problem when the commit was already accepted.
Rollback Restores the previous saved release, when one is available. This changes the live files without rewriting your Git history. A later redeploy or push can publish the deploy branch again.
Repair Reinstalls the repository's deployment hooks and configuration. Use it when instructed by an error message or Support. It does not recover lost Git history or serve as a backup.
View log Displays recent deployment times, commit identifiers, statuses, and messages.
Disable Removes the hosted Git repository and its deployment working files. The live website files stay in place. Keep your local repository and any backups you need before disabling Git.

After disabling Git, you can continue managing the live files through SFTP or the File Manager. To enable Git again, you must first back up and empty the website root.

Troubleshooting

The website root must be empty

Back up and remove the existing website files through SFTP or the File Manager, then try Enable Git again. Check for starter files, hidden files, and files inside subfolders. Git checks the website root, even if your site previously used a document root such as wordpress.

SSH authentication fails

Confirm that the SSH account is active and that the remote URL matches the one on the Git Deploy page. Use your SSH account credentials. If using a key, confirm that its public key is authorized for that SSH account and that your computer is using the matching private key. Your network must allow access to the SSH server and port shown in the remote URL.

The remote named bravehost already exists

Check the configured URL:

git remote -v

If bravehost should point to this website, update it with the URL from the Git Deploy page:

git remote set-url bravehost YOUR_REMOTE_URL

The push is rejected

Read the rejection message. Confirm that you are pushing to the deploy branch shown on the page and that the update contains no submodules or unsafe paths. Large updates can also be rejected by the server's size limit. Remove unnecessary large files from the commits being pushed; deleting a file only from your latest working copy does not remove it from earlier commits.

For a non-fast-forward rejection, reconcile your local history with the remote before retrying. Do not force-push without understanding which remote commits would be replaced.

Git accepted the push, but the website did not update

An accepted push and a successful publication are separate steps. Check the remote messages and View log for the publication result. Fix the reported problem and use Redeploy to retry the commit already on the remote. Repeating an unchanged push may simply report that everything is up to date.

If the message says A deploy is already in progress, wait for that deployment to finish before trying Redeploy again.

If publication reports that it stopped partway, the live website may be partially updated. Use Rollback if a previous release is available, and contact Support if recovery fails. Rollback is unavailable until a previous release has been saved.

Files are missing or the wrong folder appears on the website

Confirm that the files were committed and pushed. Git publishes the root of the deploy branch; it does not automatically select a dist, build, or public subfolder. Prepare a repository or deploy branch whose root contains the files you want served, including your entry page such as index.html or index.php.

Storage is full

The hosted repository counts against your storage allowance in addition to your live website. Git history and deployment working files also consume space. Replacing or deleting a large file in a later commit does not necessarily remove its older versions from Git history. Free space or contact Support before retrying publication.

Related help