git命令

初始化本地仓库

git init

设置账户、邮箱

git config --global user.name "test"
git config --global user.email "test@zhclyg.com"

clone下载

git clone 地址

git add . (-a)
git commit -m "备注"
git push

git日志

git log
git log --pretty=oneline

切换版本

git reset
git reset --hard id

查看分支

git branch -a -l -r
git checkout master v1

参考链接

https://www.cnblogs.com/ideal-20/p/13644420.html
https://juejin.im/post/6869519303864123399

原文地址:https://www.cnblogs.com/kylingx/p/13638890.html