首先下载完git之后
打开Git Bash

配置你的邮箱和用户名(github或gitee):
$ git config –global user.name “注册时账号的名字”
$ git config –global user.email “注册时使用的邮箱”
获取ssh公钥:
ssh-keygen -t rsa -C “你注册时的邮箱号”
敲三次回车生成ssh公钥
用一下命令查看:
cat ~/.ssh/id_rsa.pub
将获取到的公钥粘贴到你的github或者gitee上


之后就是自己文件的上传与下载
点开想要上传的文件夹的Git Bash Here

进入之后画面如下

git init 初始化git仓库
git remote add origin 你的项目地址

git add . 添加文件到缓存区(必须加点)
git commit -m “备注”(引号内填入你的备注)
git push origin master正式上传到github或gitee的你的仓库中。
git push origin master -f 强制推送,舍弃线上代码
之后就可以在你的仓库中看到你push的项目了