Ubuntu配置git环境

1首先终端输入git,查看git有没有安装

2.如果没有安装的话,下面是安装命令

sudo apt-get install git

3.安装完成后,进行git用户配置

git config --global user.name "xxx"
git config --global user.email "xxx"

4.注意:git是通过ssh的方式访问资源库的,所以需要载本地创建验证用的文件

ssh-keygen -C '[email protected]' -t rsa

5.向github上传公钥

cd ~/.ssh
gedit id_rsa.pub

6.然后将公钥复制到github上即可,

具体步骤:点击右上角的个人头像,点击settings,会看到左侧有个ssh,进入菜单,再点击右上角的new ssh,

将刚刚的id_rsa.pub里的文件全部复制即可

猜你喜欢

转载自blog.csdn.net/qq_39837804/article/details/103983985
今日推荐