一个我用来上传代码到Github的 Shell 脚本

因为用git老是要敲许多命令。所以写了个小脚本。代码如下:

 1  #! /bin/sh
 2   echo Going to simpleWebtest...
 3   cd ~/softwaredevelopment/workspace/simpleWebtest
 4   echo check git status...
 5   git status
 6   
 7   echo "commit?(yes/no)"
 8   read choice
 9   
10   if [ ${choice} = yes ]
11   then echo Please Enter the commit message:
12    else echo Not commited.
13       exit
14    fi
15   
16   read message
17   #echo message is $message
18  
19   git add .
20   git commit -m"$message"
21   echo committed
22   echo "push to git?(yes/no)"
23   read push_choice
24  
25   if [ ${push_choice} = yes ]
26   then echo trying to push to origin master...
27   git push origin master
28   else echo Not pushed.
29   fi

 

posted on 2014-04-07 13:53  又是你  阅读(755)  评论(0编辑  收藏  举报

导航