天天看點

Couldn't find host in the .netrc file問題解決

今天在下載下傳webRTC代碼的時候,出現以下坑。。。【前提是已經翻好了牆哈。。。】

origin' 'https://webrtc.googlesource.com/src.git'

* Couldn't find host webrtc.googlesource.com in the .netrc file; using defaults

*   Trying 74.125.204.82...

* TCP_NODELAY set

*   Trying 2404:6800:4008:c04::52...

* TCP_NODELAY set

* Immediate connect fail for 2404:6800:4008:c04::52: No route to host

或者Couldn't find host chromium.googlesource.com in the .netrc file.................的錯誤資訊。一直無法下載下傳。

Google搜尋的時候,發現大家會有Couldn't find host   ***  in the .netrc file的問題,衆說紛纭

有的人提示是需要修改git的配置,比如

git config --global http.postbuffer=524288000
git config --global http.maxrequestbuffer=100M
           

但是醬紫仍然不行。。。還試了一堆别的辦法。

後來找到修改.netrc檔案【Mac系統位于~/.netrc】并修改之,但格式錯誤的時候仍會有問題,修改格式後搞定!!

machine webrtc.googlesource.com      #要通路的位址的一級域名
login MyUsername                     #自己的使用者名
password MyPassword                  #自己的密碼

machine chromium.googlesource.com     #其他位址域名
           

注意要按照上面的格式喔~~~~~~~