git 创建服务端库Shell脚本

来源:互联网 发布:俄罗斯聊天软件下载 编辑:程序博客网 时间:2024/06/08 12:22



Shell 脚本如下:

#!/bin/bashmain(){    if [ $# -ne 1 ];    then        echo -e '请在命令后面加上项目名称'       return;    fi        cd /home/git/gitRepo        git init --bare ${respName}.git        chown -R git:git ${respName}.git        chmod go-wrx ${respName}.git        cd ~}respName=$1alias ..='cd ..'curdate=`date '+%Y%m%d'`#execute main functionmain $@


执行脚本:

. 脚本文件名  仓库名称
例如: . initResp test

就会创建test.git的仓库


0 0
原创粉丝点击