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 git@github.com:user/repository.git
相关推荐
zhixingheyi_tian4 分钟前
Linux/Windows 免密登录
linux·运维·服务器
Uso_Magic4 分钟前
SQLSERVER__EXPLAIN 常用分析案例。
服务器·数据库·sql
JicasdC123asd8 分钟前
CGNet上下文引导网络改进YOLOv26下采样特征保留能力
网络·yolo
尤老师FPGA25 分钟前
petalinux制作linux系统flash+sd卡启动
linux·运维·服务器
蓝天居士29 分钟前
Linux实用功能代码集(4) —— 线程间消息队列(2)
linux
Name_NaN_None1 小时前
Linux 使用 Remmina 连接 Windows 远程桌面 ——「小白教程」
linux·网络·电脑·远程工作
shepherd1111 小时前
别再无脑 cat 了!后端排查 GB 级生产日志的实战命令
linux·后端
桌面运维家1 小时前
Prometheus服务器监控告警实战指南
运维·服务器·prometheus
cyforkk1 小时前
前端架构实战:当服务器关闭时,如何优雅提示 502 错误?
服务器·前端·架构
剪刀石头布Cheers1 小时前
Ubuntu安装向日葵远程黑屏
linux·运维·ubuntu