In our Continuous Integration environment we do very heavy usage of git clone
and git update
.
Sometimes the network or the central git server is not reliable.
Is there a way to tell git to retry if the http request failed?
Example:
500 Internal Server Error while accessing https://example.com/repos/foo_bar/info/refs?service=git-upload-pack
Run below command
while ! git push; do sleep 7; done
This is a wrapper around git commands, it recognizes when a command fails and retries
git retry [-v] [-c COUNT] [-d DELAY] [-e] — <git_subcommand>
More information on this can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With