sourceTree工具git和gitlab协同使用

随着年龄的增加,我发现自己记性越来越差,有些东西几个月就忘记了,再想做的时候一脸懵逼。但是有句话说的不是挺好么:好记性不如烂笔头,那我就抽点时间整理一下,以便自己回头看,同时为了其他同行们做个参考。

       以下就是sourceTree协同git、gitlab的使用:

一、下载git并安装

        二、下载sourceTree并安装

        三、主要讲解配置公钥ssh key

          1、右键选择gitbash,打开终端。

  2、设置git的username和email

$ git config --global user.name "zhangsan"

$ git config --global user.email "zhangsan@gmail.com"

3、生成SSH秘钥过程

(1)查看是否已经存在ssh秘钥:cd ~/.ssh

(2)生成秘钥

$ ssh-keygen -t rsa -C “zhangsan@gmail.com”

按3个回车,密码为空。

Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………


最后得到了两个文件:id_rsa和id_rsa.pub

4.测试:ssh git@github.com

The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.


  四、打开gitlab网站,添加SSH key

       

五、打开SourceTree

1、工具-选项


以上设置完毕,就可以了。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值