Mac 查询IP配置,网络代理

常用命令

1.查询IP

objectivec 复制代码
ifconfig | grep "inet"

2.ping查询

objectivec 复制代码
ping 172.18.54.19(自己IP)

3.取消代理,通过在终端执行以下命令,可以取消 Git 的代理设置

objectivec 复制代码
git config --global --unset http.proxy 
git config --global --unset https.proxy

4.设置代理

objectivec 复制代码
// 命令行设置 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.设置代理完成后,可以通过以下命令检验是否设置成功:

objectivec 复制代码
git config --global --get https.proxy
git config --global --get http.proxy

或者

objectivec 复制代码
git config --global -l

常见错误处理

问题一、RPC failed; curl 92 HTTP/2

1.第一种方式:增加git缓存

css 复制代码
git config --global http.postBuffer 157286400

2.第二种方式:强行git使用http/1.1

复制代码
git config --global http.version HTTP/1.1

常用下载

1.curl的基本使用

css 复制代码
// 回应整个网页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使用方式

objectivec 复制代码
// 克隆到当前目录
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 [email protected]:user/repository.git
相关推荐
电鱼智能的电小鱼20 分钟前
EFISH-SBC-RK3588无人机地面基准站项目
linux·网络·嵌入式硬件·机器人·无人机·边缘计算
电鱼智能的电小鱼26 分钟前
基于 EFISH-SBC-RK3588 的无人机环境感知与数据采集方案
linux·网络·嵌入式硬件·数码相机·无人机·边缘计算
小诸葛的博客1 小时前
详解Linux中的定时任务管理工具crond
linux·运维·chrome
一默19911 小时前
CentOS 7.9升级OpenSSH到9.9p2
linux·运维·centos
Arenaschi1 小时前
SQLite 是什么?
开发语言·网络·python·网络协议·tcp/ip
船长@Quant2 小时前
协作开发攻略:Git全面使用指南 — 引言
git·版本控制·源代码管理·协作开发
keep intensify2 小时前
Linux常用指令
linux·服务器·php
带电的小王2 小时前
sherpa-ncnn:Linux(x86/ARM32/ARM64)构建sherpa-ncnn --语音转文本大模型
linux·语音识别·实时音视频·sherpa-ncnn
沧浪之水!2 小时前
【Linux网络】:套接字之UDP
linux·网络·udp
BranH2 小时前
Linux系统中命令设定临时IP
linux·运维·服务器