原理
流程
设置
ssh-keygen -t rsa -C <e-mail>
git init <你的存储库>
git config (--global) user.name <name>
git config (--global) user.email <email>
git config (--global) core.quotepath false #解决git中文乱码问题
将~/.ssh/rsa.pub
中的密钥上传至服务器
git remote add gitee/github/gitlab/<name> git@gitee.com:xxx/xxx.git
使用
git add <file>
git commit -m <message>
git push (-f) gitee/github/gitlab
附:常用命令
git log #显示当前版本库的管理情况
git log --graph #命令行图形化显示当前版本库的管理情况
git status #显示当前本地存储库的管理情况
git diff <file> #显示暂存区与工作区的差异
git diff --cache <file> #显示暂存区与本地库的差异
git restore -S <file> #将文件从暂存区丢回工作区
git restore -W <file> #撤销工作区的修改
git switch <branch> #切换至某分支
git remote -vv #显示本仓库对应的远程库及相关信息
git branch #新建分支
git branch -vv #显示所有分支及信息
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。