#/bin/sh
#1、创建一个git目录
mkdir workspace
cd workspace
#2、建立你的git仓库
git init
#3、仓库目录下添加一个文件
echo "this is a git test " >> main.c
#4、提交到仓库
git add main.c
git commit -m "version 1"
#5、在本地的git仓库添加一个远程仓库,这个仓库就是你自己的目录
git remote add origin ssh://`ifconfig eth0|grep "inet addr" | cut -d":" -f2 | cut -d" " -f1`/`pwd`/.git
#6、将本地分支,跟踪到远程的分支
git push origin master
#7、显示远程信息
git remote show origin
#8、建立一个中心的仓库
cd ../
mkdir workrepos
cd workrepos
git clone --bare ../workspace
echo "++++++++++++++++++++++++++++++"
echo "create git 仓库成功"