【发布时间】:2019-01-22 09:11:36
【问题描述】:
在 bash 脚本中,我想像这样循环遍历所有 git 遥控器
for remote in $(git remote)
do
git remote prune $remote
done
问题在于,在我的情况下,用于当前不可用遥控器的git remote 命令不会在合理的时间内超时,而是挂起。
如何编写脚本以使其忽略当前不可用的 git 遥控器?
更新:
git 连接是通过 ssh 发生的。
【问题讨论】:
-
也许你可以看看这里:superuser.com/questions/227509/…
-
@olibiaz
git ls-remote命令显示相同的行为并且不会超时。 -
@borrible 设置 http.lowSpeedTime 和 http.lowSpeedLimit 不会改变行为。