CentOS搭建Git,MacOS克隆

服务器
#yum install git
#adduser git
#passwd git
#su git
$cd~
$mkdir .ssh && chmod 700 .ssh
$touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
$mkdir repos
$cd repos
$git init -–bare server.git

客户端
$git init
$git config –-global user.name “你的名字”
$git config –-global user.email “你的邮箱”
$ssh-keygen

输入密码

$cat ~/.ssh/id_rsa.pub | ssh git@192.168.1.1 “cat ->> ~/.$ssh/authorized_keys”
$git clone git@192.168.56.102:/home/git/repos/server.git

 

sourcetree url地址 git@192.168.56.102:/repos/server.git

posted @ 2017-03-21 16:00  秋裤大叔  阅读(154)  评论(0编辑  收藏  举报