Is there a way to make git over http timeout?

前端 未结 3 1203
感动是毒
感动是毒 2020-12-16 13:09

I\'m having a script running git clone/pull automatically (this is actually happening inside jenkins CI, but my question is more general). The remote git server is HTTPS bas

相关标签:
3条回答
  • 2020-12-16 13:40

    Additional to CAD bloke's answer:

    Also

    git config --global http.lowSpeedLimit 1000
    git config --global http.lowSpeedTime 600
    

    works fine.

    The above example means the remote action will block when the speed kept below 1KB/s for 600 seconds(10min), the action will block.

    0 讨论(0)
  • 2020-12-16 13:55

    You can try using

    http.lowSpeedLimit, http.lowSpeedTime

    If the HTTP transfer speed is less than http.lowSpeedLimit for longer than http.lowSpeedTime seconds, the transfer is aborted. Can be overridden by the GIT_HTTP_LOW_SPEED_LIMIT and GIT_HTTP_LOW_SPEED_TIME environment variables.

    0 讨论(0)
  • 2020-12-16 13:58

    Add this to .gitconfig ...

    [http]
    lowSpeedLimit = 1000
    lowSpeedTime = 20
    

    lowSpeedLimit is bytes per second

    I call it the Codeplex clause.

    0 讨论(0)
提交回复
热议问题