使用git结合backlog
1.生成公钥和私钥
$ ssh-keygen -t rsa
输入以上命令会出现下列提示信息
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ito_kazunori_gn/.ssh/id_rsa):
Created directory '/Users/ito_kazunori_gn/.ssh'.
Enter passphrase (empty for no passphrase):(可以为空)
Enter same passphrase again:
Your identification has been saved in /Users/ito_kazunori_gn/.ssh/id_rsa.
Your public key has been saved in /Users/ito_kazunori_gn/.ssh/id_rsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ito_kazunori_gn@PC-4828.local
生成完成后
通过 more /Users/ito_kazunori_gn/.ssh/id_rsa.pub获得公钥
把里面的字符传拷贝在backlog,ssh设定的地方即可。
2.生成配置文件
vi ~/.ssh/config
配置文件中输入下列信息后保存
Host easter.git.backlog.jp
Usereaster
IdentityFile ~/.ssh/id_rsa_backlog_git
3.mv ~/.ssh/id_rsa ~/.ssh/id_rsa_backlog_git
4.测试连接是否成功
ssh backlog.jp
若成功会出现下列提示信息
The authenticity of host 'easter.git.backlog.jp (54.248.107.22)' can't be established.
RSA key fingerprint is 25:c4:1e:3b:c9:5e:d9:7b:e3:3f:d5:3d:ac:84:c8:4d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'backlog.jp,54.248.107.22' (RSA) to the list of known hosts.
Hi kazunori.ito@sina.com! You've successfully authenticated, but Backlog does not provide shell access.
Connection to easter.git.backlog.jp closed
5.创建项目工作目录
mkdir ~/Document/project/git
cd ~/Document/project/git
6.git配置文件定义
git config --global user.name "username"
git config --global user.email "usermail"
上面两个配置可以随便写,但是这个对你身份的标识,通过这个标识别人通过log可以看到是谁提交的。
7.从远程服务器到处仓库
git clone backlog.jp/XXX.git
备注:
1.如果仅仅使用git,不关联backlog的话,可以省略2,3步.
2.第4步只是测试,对安装工作无影响。
$ ssh-keygen -t rsa
输入以上命令会出现下列提示信息
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ito_kazunori_gn/.ssh/id_rsa):
Created directory '/Users/ito_kazunori_gn/.ssh'.
Enter passphrase (empty for no passphrase):(可以为空)
Enter same passphrase again:
Your identification has been saved in /Users/ito_kazunori_gn/.ssh/id_rsa.
Your public key has been saved in /Users/ito_kazunori_gn/.ssh/id_rsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxx
生成完成后
通过 more /Users/ito_kazunori_gn/.ssh/id_rsa.pub获得公钥
把里面的字符传拷贝在backlog,ssh设定的地方即可。
2.生成配置文件
vi ~/.ssh/config
配置文件中输入下列信息后保存
Host easter.git.backlog.jp
3.mv ~/.ssh/id_rsa
4.测试连接是否成功
ssh backlog.jp
若成功会出现下列提示信息
The authenticity of host 'easter.git.backlog.jp (54.248.107.22)' can't be established.
RSA key fingerprint is 25:c4:1e:3b:c9:5e:d9:7b:e3:3f:d5:3d:ac:84:c8:4d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'backlog.jp,54.248.107.22' (RSA) to the list of known hosts.
Hi kazunori.ito@sina.com! You've successfully authenticated, but Backlog does not provide shell access.
Connection to easter.git.backlog.jp closed
5.创建项目工作目录
mkdir ~/Document/project/git
cd ~/Document/project/git
6.git配置文件定义
git config --global user.name "username"
git config --global user.email "usermail"
上面两个配置可以随便写,但是这个对你身份的标识,通过这个标识别人通过log可以看到是谁提交的。
7.从远程服务器到处仓库
git clone backlog.jp/XXX.git
备注:
1.如果仅仅使用git,不关联backlog的话,可以省略2,3步.
2.第4步只是测试,对安装工作无影响。
评论: