终端代理

export ALL_PROXY='http://home.smallkun.cn:20171' 
export http_proxy='http://home.smallkun.cn:20171' 
export https_proxy='http://home.smallkun.cn:20171' 

unset ALL_PROXY
unset http_proxy
unset https_proxy

git config --global http.proxy 'http://home.smallkun.cn:20171' 
git config --global https.proxy 'http://home.smallkun.cn:20171' 

Git

代理配置

# 设置 HTTP 代理
git config --global 'http://home.smallkun.cn:20171' 
git config --global 'http://home.smallkun.cn:20171' 

# 移除 HTTP 代理
git config --global --unset http.proxy
git config --global --unset https.proxy

#验证代理配置
git config --global --get http.proxy
git config --global --get https.proxy

# 进入仓库目录
cd your-repo

# 设置 HTTP 代理
git config http.proxy http://proxyuser:proxypassword@proxy.server.com:port
# 设置 HTTPS 代理
git config https.proxy https://proxyuser:proxypassword@proxy.server.com:port

push.sh

#!/bin/bash
# 一次性处理git提交
#branch_name=`git symbolic-ref --short -q HEAD`
branch_name=$(git symbolic-ref --short -q HEAD)
if [ ! -n "$1" ] ;then
commit=`date +%Y-%m-%d`
else
commit=$1
fi
git add .
git commit -m "$commit"
git push origin "$branch_name"

pull.sh

#!/bin/bash
# 一次性处理git拉取
#branch_name=`git symbolic-ref --short -q HEAD`
branch_name=$(git symbolic-ref --short -q HEAD)
git pull origin "$branch_name"

配置全局命令

vim .zshrc

alias push="sh /home/ikun/sh/push.sh"
alias pull="sh /home/ikun/sh/pull.sh"