Enable the automated pruning of old branches in your project
To keep your repository size to a minimum, make sure that branches that don’t exist anymore in your repository have also been deleted from Upsun. To automate this process, when setting up a source integration, enable theprune-branches option.
If you already have a source integration set up and want to enable the prune-branches option,
follow these steps:
- Using the CLI
- In the Console
-
To enable the
prune-branchesoption, you must first enable thefetch-branchesoption. To do so, run the following command: -
Then, to enable the
prune-branchesoption, run the following command:
Upload your files through mounts
Keeping too many files, especially large binary files, in your Git repository can cause performance and stability issues. Therefore, Upsun recommends that you only commit your source code in Git. To upload any other files to your app, create mounts and transfer your files directly to them.Troubleshoot a sizeable Git repository
If you’re experiencing latencies or can’t access your Console anymore, your Git repository may have become too large and may need to be cleaned up. To do so, follow these instructions:- Remove old, unwanted files from your repository (especially large files). You can do it manually, or use a tool such as BFG Repo-Cleaner.
- Remove stale branches from your repository and Upsun project.
- Rebase and/or squash commits to clean up your history.
- Make sure you enable the automated pruning of old branches in your project and upload your files through mounts to avoid facing the same situation in the future.