git Reference Error
You may encounter the following error messages when running a git push
from a CI platform, such as Circle CI, Travis CI, Jenkins and others:
(Where COMMIT_HASH
is a long hexadecimal number)
Cause
These errors are all caused by pushing from a shallow clone.
Shallow clones are often used by CI platforms to make builds faster, but you can’t push from a shallow clone to another git repository, which is why this fails when you try pushing to Aptible.
Resolution
To solve this problem, update your build script to run this command before pushing to Aptible:
If your CI platform uses an old version of git, --unshallow
may not be available. In that case, you can try fetching a number of commits large enough to fetch all commits through to the repository root, thus unshallowing your repository:
Was this page helpful?