git命令

git config --global -name ( 设置个人变量记录 )

git commit -m #提交到本地仓库并且注释

git add . #添加到缓存区

git checkout #恢复删除文件

git rm --cached# 删除文件

git reset HEAD# 恢复本地库文件

git reset --hard (版本id号)# 指定版本号恢复

git reset --hard HEAD^# 恢复本地库上个版本

git log#查看本地库所有版本

git log --oneline#简化信息输出所有版本号

git reflog #查看版本回退与提交

git stash save “备注信息”

git clone (加url) #从码云或github下载库

image-20210813183309947

git branch#查看分支

git branch “分支名字” #创建分支

git branch checkout “名字”

git checkout 切换master或分支名字

git branch -D “分支名字”

git merge “分支名字”

git tag -a(标签名字) -m(给标签做个注释) #创建标签

git log --oneline --decorate#查看标签的版本号

git show “标签名字”#查看指定标签

git tag -D “标签名字”#删除标签

git tag (版本号)