常用命令
1.查詢IP
ifconfig | grep "inet"
2.ping查詢
ping 172.18.54.19(自己IP)
3.取消代理,通過在終端執行以下命令,可以取消?Git?的代理設置
git config --global --unset http.proxy
git config --global --unset https.proxy
4.設置代理
// 命令行設置 IP 和 host
git config --global http.proxy 'socks5://127.0.0.1:7890'
git config --global https.proxy 'socks5://127.0.0.1:7890'
5.設置代理完成后,可以通過以下命令檢驗是否設置成功:
git config --global --get https.proxy
git config --global --get http.proxy
????????或者?
git config --global -l
常見錯誤處理
問題一、RPC failed; curl 92 HTTP/2
1.第一種方式:增加git緩存
git config --global http.postBuffer 157286400
2.第二種方式:強行git使用http/1.1
git config --global http.version HTTP/1.1
常用下載
1.curl的基本使用
// 回應整個網頁html格式
curl https://www.baidu.com/
// 將文件下載并命名
curl -o 林.mp3 http://123.249.125.223:7898/wcy/file.mp3
// 下載文件不進行重命名
curl -O http://123.249.125.223:7898/wcy/file.mp3
2.git clone使用方式
// 克隆到當前目錄
git clone https://github.com/user/repository.git
// 這會將倉庫克隆到名為 mydirectory 的目錄下
git clone https://github.com/user/repository.git mydirectory
// --branch <branch>: 克隆指定分支而不是默認的主分支
git clone --branch develop https://github.com/user/repository.git
//--depth <depth>: 使用淺克隆,只獲取最近的 <depth> 次提交的歷史
git clone --depth 1 https://github.com/user/repository.git// 使用SSH克隆倉庫
git clone git@github.com:user/repository.git
?