git init
git add . / git add 文件名
git commit -m "描述信息"
git reflog
git log
--- 回滚到指定的版本号 暂存区、本地库、工作区同步更新
git resrt --hard 版本号
--- 查看分支
git branch
--- 创建分支
git branch 分支名
--- 切换分支
git checkout 分支名
--- 合并到之前切换的主分支上
git merge 分支名
--- 删除分支
git branch -d 分支名
--- 给远程仓库起别名
git remote add orgin URL
--- 像远程仓库中推送代码
git push -u orgin 分支名
--- 克隆远程仓库代码
git clone URL
--- 更新代码
git pull orgin 分支名
--- 提交代码
git push orgin 分支名
--- 变简:合并提交的记录
git rebase -i 版本号/HEAD~x
--- 给分支增加标签
1. 添加标签
git tag -a 标签 -m "描述信息"
2. 推送到远程
git push orgin --tags
git常用的命令总结
于 2020-05-29 19:10:57 首次发布