远程服务器git搭建

在远程服务器如:/var/www下创建hello.git

然后git init --bare hello.git

cd hello.git会看到下面的目录和文件

然后创建可以访问git的用户

git config --global user.name "name" 例如:json

git config --global user.email "json@127.12.25.44"

创建完成

本地操作:

git clone root@127.12.25.44:/var/www/hello.git

之后随便写一个文件然后git add .

git commit -m 'update'

git config --global user.name "json" 例如:json

git config --global user.email "json@127.12.25.44"

git push

之后可以通过git branch 查看master分支

posted @ 2017-01-13 00:56  一样菜  阅读(1563)  评论(0编辑  收藏  举报