1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
alias hgu='hg pull;hg up;' hgp() { hg st | grep '^\!' | awk '{$1="";print substr($0,2)}' | xargs -d '\n' hg add hg st | grep '^\!' | awk '{$1="";print substr($0,2)}' | xargs -d '\n' hg remove if [ -z ${1} ]; then hg commit -m"update"; else hg commit -m"${1}"; fi hg push } gitp() { git add . if [ -z ${1} ]; then git commit -m"update"; else git commit -m"${1}"; fi git push }