`
shappy1978
  • 浏览: 679163 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Setup Git

 
阅读更多

http://www.tomdalling.com/blog/software-processes/how-to-set-up-a-secure-git-server-at-home-osx/

 

* /etc/ssh/sshd_config, must delete the comment tag "#"

touch .ssh/authorized_keys  //new file
open -a "TextEdit" .ssh/authorized_keys  //open with textedit

 

1) 在 server 端创建空的 repository  //initialize server git

$ cd path/to
$ mkdir newrepo.git
$ cd newrepo.git
$ git init --bare
# --bare flag 只是用来存储 pushes,不会当做本地 repository 来使用的。

    2) 在 client 端,创建 local repository 并 push  //creat local git and add to remote

$ cd path/to
$ mkdir newrepo
$ cd newrepo
$ git init
$ touch README
$ git add .
$ git commit -m "initial commit"
$ git remote add origin git@yourComputerName:/path/to/newrepo.git # 如果直接之前在 server 端创建的 newrepo.git 是在 home 目录,则这里地址为:git@yourComputerName:newrepo.git
$ git push origin master

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics