1.默认你Git已经下载好的情况下。
下载好的两种显示:
1.右击桌面显示这个

2.如果没有情况1出现,需要自己去创建快捷方式

2.去网站创建仓库
网站参考:yanyongzhitest/java_web - 码云 - 开源中国 (gitee.com)
新建仓库:

仓库名称自定义:

3.GitBash准备
然后在自己想放置的地方创建一个文件夹

然后右击出现这个打开Git Bash(或者在右击的情况下点击显示更多选项)

然后创建git目录(右边黄色字体指的是我刚刚创建文件夹的地址)

(然后会在文件夹lulu 这里出现.git)记得点击查看隐藏
4.SHH设置
设置SHH密钥
绑定自己的邮箱(头像->个人设置->)

邮箱管理:(然后根据提示自己设置即可)

SHH密钥设置:
生成 SSH key
① 打开Git Bash
② 粘贴如下的命令,并将 your_email@example.com 替换为注册 Github 账号时填写的邮箱:
cpp
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
③连续敲击3次回车,即可在C:\Users\用户名文件夹\.ssh 目录中生成id rsa 和 id rsa.pub 两个文件
(红色框的内容不用管,就是上面的那个)

配置 SSH key
① 使用记事本打开 id_rsa.pub文件,全选复制里面的文本内容

②在浏览器中登录 Github,点击头像 ->个人设置 ->SSH工钥
③ 将 id_rsa.pub 文件中的内容,粘贴到 Key 对应的文本框中
④ 在 Title 文本框中任意填写一个名称,来标识这个 Key 从何而来(标题自定)

最后检测SSH key 是否配置成功
打开 Git Bash,输入如下的命令并回车执行:
cpp
ssh -T git@gitee.com
然后网站用的是githup,则替换gitte
上述的命令执行成功后,可能会看到如下的提示消息:
cpp
The authenticity of host 'github.com (IP ADDRESS)' can't be established
RSA key fingerprint is SHA256:nThbg6kXUpJWG17E1IGOCSpROmTXxdCARLVKW6E5SY8.
Are you sure you want to continue connecting(yes/no)?
输入 yes 之后,如果能看到类似于下面的提示消息,证明 SSH key 已经配置成功了

cpp
Hi username! You've successfully authenticated, but GitHub does not
provide shell access.
5.用户信息配置
方法一:
打开你创建好的.git(在你一开始创建的文件下)

然后记事本打开conflg加入一下内容(加入到最下面即可)
记得替换成自己的email和name,name是你登录gitee网站的用户名,email则你你绑定的邮箱。
cpp
[user]
email=2161672768@qq.com
name=yanyongzhi
方法二:
绑定gitee用户名和邮箱
cpp
git config --global user.name "你的gitee的用户名"
git config --global user.email "你的gitee注册或绑定的邮箱地址"
6.链接仓库
在主界面点击 克隆/下载 ,SHH中复制第一行数据(也不用复制,Git好像无法输入复制的)

然后链接仓库:
@gitee.comLyanyongzhitest/lulu.git是刚刚复制的路径(注意换成自己的)

然后输入下面一行查看是否连接成功(下面为链成功的标志)
如果没有配置SHH密钥的话,则会报其他的

7.上传项目到仓库
这里我是把我要上传的项目(我这里是demo5)复制到这里来,记得放在你创建的文件下(lulu)

然后再Git Bash中输入
cs
git add .
然后输入查看状态
cpp
git status

然后继续输入:
cpp
git commit -m "new java to print the most pretty"
然后就会出现这些(下面就是一堆就是create mode 100644 什么什么(指的就是上面file后面的东西))


然后开始上传:
cpp
git push origin master

最后检查是否上传完成,刷新界面看项目名称(demo5)是否出现再仓库中
