git常用命令

|-----------------------------------|---------------|
| 命令 | 描述 |
| git branch | 查看分支; |
| git branch 分支 | 创建分支; |
| git branch -D 分支 | 删除分支; |
| git checkout 分支 | 切换分支; |
| git checkout -B 分支 | 创建并切换分支; |
| git switch 分支 | 切换分支; |
| git switch -C 分支 | 创建并切换分支; |
| git log | 查看提交历史; |
| git reflog | 查看提交历史树状; |
| git reset --hard 版本 | 版本回退; |
| git config --global user.name | 查看git的用户名称; |
| git config --global user.name 名称 | 设置git的用户名称; |
| git config --global user.email | 查看git的用户邮箱; |
| git config --global user.email 邮箱 | 设置git的用户邮箱; |
| git status | 查看更改的文件状态; |
| git add . | 提交全部更改文件到缓存区; |
| git add 文件 | 提交指定更改文件到缓存区; |
| git commit -m "描述" | 提交到缓存区的描述; |
| git pull | 拉取远程仓库代码; |
| git push | 提交到远程仓库代码; |
| git remote -v | 查看远程仓库信息; |
| git remote add 远程仓库链接 | 本地连接远程仓库; |
| git remote add 远程仓库链接/origin | 本地连接并关联远程仓库; |
| git remote rm 远程仓库链接 | 本地删除远程仓库; |

相关推荐
天地人-神君2 小时前
将.idea取消git托管
java·git·intellij-idea
Zach_yuan6 小时前
版本控制器Git
linux·git
唐青枫11 小时前
Git 提交时神秘的 create mode 100644 到底是什么?一文告诉你答案!
git
春生野草12 小时前
Git-git stash与分支管理
git
ljh57464911912 小时前
Git合并冲突解决方法
git
悟能不能悟12 小时前
git revert commit和undo commit的区别
git
222you1 天前
Git的diff命令
git
补三补四1 天前
Git 基础操作指南
大数据·git·elasticsearch
222you1 天前
git的命令
git
Coolbike1 天前
Git工作流
git