Git "warning: redirecting to https://..." in CI
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.
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/'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.
git remote set-url origin https://github.com/org/repo.git
git remote -vAllow credential reuse on redirect if you must redirect
When you cannot change the URL, let Git replay credentials across the redirect.
git config --global http.followRedirects true
git -c credential.helper= -c http.followRedirects=true push origin mainHow to prevent it
- Always configure remotes with the canonical
https://host/org/repo.gitURL. - Avoid
http://remotes in CI entirely. - Keep the trailing
.gitso the host does not normalize the path.