温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Ubuntu git安装和使用

发布时间:2020-07-20 06:59:49 来源:网络 阅读:708 作者:tfjay914 栏目:开发技术
  1. git --version

如果命令找不到就要安装。


2.sudo apt-get install git

安装git


3.git config --global user.name "tongfan"

配置user.name


4.git config --global user.eamil "tongfan@followme.com"

配置你的Git上注册的邮箱地址这个一定要确定,ssh通讯时要用到。


5.ssh-keygen -C 'tongfan@followme.com' -t rsa

一直回车直到完成。生成RSA公钥:id_rsa.pub和私钥:id_rsa


6.把id_rsa.pub公钥的内存copy

Ubuntu git安装和使用


7.Settings->SSH and GPG keys->New SSH Keys

这里有github.com为列子:https://github.com/settings/profile

标题填邮箱名,Key填is_rsa.pub的内容。

Ubuntu git安装和使用


8.测试设置是否成功。

root@ubuntu:~/code# git clone git@github.com:micro/examples.git

Cloning into 'examples'...

remote: Counting objects: 301, done.

remote: Total 301 (delta 0), reused 0 (delta 0), pack-reused 301

Receiving objects: 100% (301/301), 85.78 KiB | 28.00 KiB/s, done.

Resolving deltas: 100% (80/80), done.

Checking connectivity... done.


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI