GitHub庫無法下載解決方案

最近GitHub被墻的很厲害,也可能是網(wǎng)絡(luò)被限制,導(dǎo)致打包機(jī)一直拉不下代碼,用fq工具,然后各種配置都不行。偶然發(fā)現(xiàn)gitconfig有替換URL功能,想到一個(gè)方法。先把GitHub的代碼導(dǎo)入到碼云或者你們公司的代碼平臺(tái),再更換URL映射。

很多報(bào)無法訪問錯(cuò)誤:

[!] Error installing ReactiveObjC

[!] Error installing SDWebImage

[!] Error installing SSZipArchive
[!] /usr/bin/git clone [https://github.com/ZipArchive/ZipArchive.git](https://github.com/ZipArchive/ZipArchive.git) /var/folders/6h/bhmdvd9s1rxc40_xhz9g2rww0000gn/T/d20221122-79068-1nux8ny --template= --single-branch --depth 1 --branch v1.8.1

Cloning into '/var/folders/6h/bhmdvd9s1rxc40_xhz9g2rww0000gn/T/d20221122-79068-1nux8ny'...
fatal: unable to access '[https://github.com/ZipArchive/ZipArchive.git/](https://github.com/ZipArchive/ZipArchive.git/)': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 

比如替換YYText,用下面的命令:


git config --global url."https://gitee.com/xxxx/YYText.git".insteadOf https://github.com/ibireme/YYText.git

將YYText映射到自己的代碼平臺(tái),后面有庫報(bào)錯(cuò)就換掉。

上面的命令執(zhí)行完,會(huì)加到本地的 ~/.gitconfig 文件里面,也可以跳過命令直接修改該文件。

[url "https://gitee.com/xxxx/YYText.git"]
    insteadOf = https://github.com/ibireme/YYText.git
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容