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
相关推荐
少女续续念5 分钟前
AI 不再是 “旁观者”!Gitee MCP Server 让智能助手接管代码仓库管理
git·开源
naice18 小时前
我对github的图片很不爽了,于是用AI写了一个图片预览插件
前端·javascript·git
会飞的青蛙1 天前
GIT 配置别名&脚本自动化执行
前端·git
用户31187945592181 天前
Kylin Linux 10 安装 glib2-devel-2.62.5-7.ky10.x86_64.rpm 方法(附安装包)
linux
涛啊涛1 天前
Centos7非LVM根分区容量不足后扩容,对调硬盘挂载/
linux·磁盘管理
CYRUS_STUDIO2 天前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李2 天前
rootfs-根文件系统详解
linux
dessler2 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs
泽泽爱旅行2 天前
awk 语法解析-前端学习
linux·前端
权咚3 天前
阿权的开发经验小集
git·ios·xcode