https://gitee.com/xbf392/graduation_project
**生成秘钥
ssh-keygen -t rsa -C "youremail@example.com"
1、进行初始化将目录变成仓库
git init
2、设置姓名以及邮箱
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
3、关联到远程仓库
git remote add origin 你的远程库地址
4、远程库与本地同步合并
git pull --rebase origin master
5、把文件添加到本地版本库
git add .
6、用命令git commit把文件提交到仓库
git commit -m 'note'
7、将最新的修改推送到远程仓库
git push -u origin master
8、拷贝代码
git clone你的远程库地址
git remote -v //查看提交方式
git remote set-url origin git@github.com:GitRepoName.git//设置提交方式
命令查看连接的远程的仓库
git remote -v
修改远程连接的仓库
git remote set-url origin [url]
可以允许不相关历史提,强制合并
git pull origin master --allow-unrelated-histories
删除本地仓库commit中文件
git rm -r --cached 文件名
soft reset N次 commit,也就是回退N次commit,这里的N取决于你的需求
git reset --soft HEAD~3
更多修改命令
https://blog.youkuaiyun.com/qq_44695727/article/details/109225721