git 创建远程仓库

在远程服务器上
$ cd /server/path/ $ git init --bare myproject.git

在本地

1> $ cd /client/path/

运行 git init

2> $ git remote add origin ssh://root@hostname/server/path/myproject.git
or
2> $ git remote add origin git@hostname:myproject.git

3> $ git status
第三步只是查看状态, 可以不要的, 也可以查看一下远程地址 $ git remote -v
然后, 可以添加一些初始化的数据
4> $ git add .
5> $ git commit -m "初始化"
6> $ git push origin master
 
posted @ 2014-12-24 12:33  Debm.Zhang  阅读(309)  评论(2编辑  收藏  举报