git项目配置

1.注册gitee账号

  • 1.进入gitee官网Gitee - 基于 Git 的代码托管和研发协作平台
  • 2.注册账号
    image.png

2.安装git

3.配置git

  • 1.配置姓名和邮箱
git config --global user.name "Firstname Lastname"
git config --global user.email "[email protected]"

Firstname Lastname[email protected]为自定义内容
查看配置信息是否成功

cat ~/.gitconfig

成功配置后,显示如下输出

[user]
    name = Firstname Lastname
    email = [email protected]
  • 2.设置SSH Key
    在设置SSH key之前需要前往Gitee - 基于 Git 的代码托管和研发协作平台注册一个Gitee账户。
    运行下面命令创建SSH Keys
[peko@localhost ~]$  ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/peko/.ssh/id_rsa):    #回车默认  
Created directory '/home/peko/.ssh'.
Enter passphrase (empty for no passphrase): #输入密码 
Enter same passphrase again: #再次输入密码

[email protected]改成自己的邮箱地址
输入密码以后生成如下

Your identification has been saved in /home/peko/.ssh/id_rsa.    #私有密钥
Your public key has been saved in /home/peko/.ssh/id_rsa.pub. #公开密钥
The key fingerprint is:
SHA256:rYpYFp/gnaWz/V1YWMFV0sWemPA/W8KSjuIHruBMLqI [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|             .o+*|
|           .  .oo|
|            o +..|
|         .   * ..|
|    o   S . .oo  |
|   . = =..  oooo.|
|    * B... o....+|
|. .O o =o o... . |
|E...= +oo+. .    |
+----[SHA256]-----+

id_rsa文件是私有密钥,id_rsa.pub是公开密钥

  • 3.添加公开密钥
    image.png

    image.png

    image.png

    标题栏中输入适当的密钥名称,用Company即可
    Key则需要将刚才生成的公共密钥内容复制进去
    查看id_rsa.pub文件中的内容
cat ~/.ssh/id_rsa.pub
ssh-ras 密钥内容 [email protected]

ssh-ras 密钥内容 [email protected]的内容全部复制到Key
单击确定按钮完成添加

  • 4.进行认证
ssh -T [email protected]
The authenticity of host 'github.com (13.250.177.223)' can't be established.
RSA key fingerprint is *** #fingerprint值
RSA key fingerprint is *** #fingerprint值
Are you sure you want to continue connecting (yes/no)? #输入yes

成功后出现如下结果

Hi Gpeko! You've successfully authenticated, but GitHub does not provide shell access.

4.安装pycharm

5.拉取项目

你可能感兴趣的:(git项目配置)