gitee 搭建springboot单体项目

391 阅读2分钟

以前工作学习一直没有系统的去总结。现在开始记录自己的项目经历和工作中遇到的一些问题 本文主要内容:从gitee搭建仓库-> 配置ssh密钥 ->使用ssh拉取代码 ->构建maven项目

1、搭建仓库

直接上图

第一步

image.png

第二步 image.png 创建完成如下图所示

image.png

配置ssh密钥

git相关指令

1、查看用户名和邮箱地址

git config user.name

git config user.email

2、设置用户名和邮箱地址

git config --global user.name "你的用户名"

git config --global user.email "你的邮箱地址"

3、查看是否生成过ssh

如下图,使用cd ~/.shh进入ssh,如果没有进入说明就还没有创建ssh,终端会提示cd: no such file or directory: .ssh

image.png

4、创建ssh

在终端使用命令

ssh-keygen -t rsa -b 4096 -C "你的邮箱地址"

回车:Generating public/private rsa key pair.

稍等会输出:Enter file in which to save the key (/Users/zzz/.ssh/id_rsa):

这里是要输入密码的地方,建议直接回车

如果以前创建过,则会出现已经存在的提示

/Users/***/.ssh/id_rsa already exists.

这里需要选择保留以前的还是用现在的替换,如果设置了密码或忘记密码 ,选择y

Overwrite (y/n)?

回车:

Enter passphrase (empty for no passphrase):

回车:

Enter same passphrase again:

当出现这样的画面的时候,表示创建成功了:

image-20210704153909596.png 创建成功之后会在admin里面生成一个.shh的文件(id_rsa.pub)。将文件中的内容CV之后保存到gitee中即可

5.查看公钥

执行查看公钥的命令cat ~/.ssh/id_rsa.pub

三、ssh从仓库拉取代码

1、点击克隆/下载,选择ssh

2、在idea中输入url 点击克隆即可

四、将当前项目交给maven管理

1、右击项目->选择 add framework support

image.png

2、选择maven即可。