标签:port chmod 新建 bin git user pull The 环境
Mac 自定义可执行脚本
mkdir sh
touch pull.sh
touch push.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"
#!/bin/bash
# 一次性处理git提交
#branch_name=`git symbolic-ref --short -q HEAD`
branch_name=$(git symbolic-ref --short -q HEAD)
if [ ! -n "$1" ] ;then
commit="提交"
else
commit=$1
fi
git add .
git commit -m "$commit"
git push origin "$branch_name"
chmod +x pull.sh
chmod +x push.sh
vim ~/.zshrc
# 自定义sh
export PATH="/Users/jiqing/sh:$PATH"
source ~/.zshrc
标签:port chmod 新建 bin git user pull The 环境
原文地址:https://www.cnblogs.com/jiqing9006/p/14934260.html