#!/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
password="123456"
echo $password|sudo -S git add .
echo $password|sudo -S git commit -m "$commit"
echo $password|sudo -S git push origin "$branch_name"