Slow workflow loading and builds stuck in queue for large repositories
Last updated: July 10, 2026
If workflows take a long time to load or builds remain in the Queued or Initializing state for an extended period, this may be caused by a large Git repository that takes longer for Codemagic workers to fetch and process.
Why this happens
Before a build can start, Codemagic needs to fetch the repository and read the workflow configuration. For very large repositories, especially those with long Git histories, many objects, or unpacked objects, this step can take longer than expected and may require retries. As a result, the build may appear to stay in the queue or initialization phase for an unusually long time.
Solution
You can resolve this issue by cleaning up your repository using the following steps:
For repositories hosted on platforms like GitHub, GitLab, Bitbucket:
For self-hosted Git repositories: Before modifying client-side configurations, perform maintenance on the server side:
Log into your git server (e.g.,
ssh source.example.com)Navigate to your repository directory:
cd /path/to/your/repoRun housekeeping commands:
git gc- Cleanup unnecessary filesgit repack -A- Pack unpacked objects
Important note
Simply deleting branches is usually not enough to resolve this issue. Deleted branches do not necessarily remove the underlying Git history or stored objects. Repository cleanup is needed to address the Git object storage that can cause slow workflow loading or long initialization times.