The host answered your request with a redirect to a different URL - usually http:// to https://, or a normalized path. The clone may still work, but the redirect can drop credentials or break a push, so the warning is worth fixing at the source.
What this error means
Git prints warning: redirecting to https://github.com/org/repo.git/ during a fetch or push. A fetch may succeed, but a push sometimes fails afterward because the credential was not carried across the redirect.
git output
warning: redirecting to https://github.com/org/repo.git/
# a later push may then fail:
fatal: Authentication failed for 'http://github.com/org/repo.git/'
Diagnose it: depth, refs, or credentials?
CI checkouts are shallow and detached by default, which breaks anything that needs history or a branch name. Before treating it as a credential problem, confirm what the runner actually fetched.
.github/workflows/ci.yml
- run:|git rev-parse --is-shallow-repositorygit rev-parse --abbrev-ref HEAD # prints HEAD when detachedgit log --oneline -3git remote -vgit for-each-ref --format="%(refname)" | head
Common causes
Remote configured with http:// or a non-canonical path
An http:// remote (or one missing the trailing .git) is 301-redirected by the host to the canonical https://...git/. Git follows it but warns.
Credentials not reused across the redirect
Git does not always replay credentials on a redirected request, so a write that needs auth can fail even though the read redirect succeeded.
How to fix it
Point the remote at the canonical HTTPS URL
Set the remote to the final https:// form so no redirect happens.
- uses:actions/checkout@v4with:fetch-depth:0 # full history: diffs, tags, git describesubmodules:recursive # submodules are NOT fetched by defaultpersist-credentials:false # if a later step pushes with its own token
How to prevent it
Always configure remotes with the canonical https://host/org/repo.git URL.
Avoid http:// remotes in CI entirely.
Keep the trailing .git so the host does not normalize the path.
Frequently asked questions
What causes Git "warning: redirecting to https://..." in CI?
There are 2 common causes: remote configured with http:// or a non-canonical path and credentials not reused across the redirect. An http:// remote (or one missing the trailing .git) is 301-redirected by the host to the canonical https://...git/.
How do I fix Git "warning: redirecting to https://..." in CI?
There are 2 fixes depending on which cause you have: point the remote at the canonical https url and allow credential reuse on redirect if you must redirect. Work through them in order, since the first is the most common.
What does Git "warning: redirecting to https://..." in CI actually mean?
Git prints warning: redirecting to https://github.com/org/repo.git/ during a fetch or push.
How do I stop Git "warning: redirecting to https://..." in CI happening again?
Always configure remotes with the canonical https://host/org/repo.git URL. The prevention section lists 3 changes that keep it from recurring.