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 远程仓库链接 | 本地删除远程仓库; |

相关推荐
PassLink_17 分钟前
常用 Git 命令
git
想和我重名?41 分钟前
Git的基本操作
git
慕羽★12 小时前
Git常用指令整理【新手入门级】【by慕羽】
linux·git·ubuntu·gitlab·github·仓库·分布式协作
鸡c13 小时前
etcd二次封装
git·github·etcd
救救孩子把13 小时前
UGit:腾讯自研的Git客户端新宠
java·开发语言·git
星叔14 小时前
git 压栈存储当前分支修改,出栈使用保存
git
狼魂豹速16 小时前
idea2024 Safe Mode解决、配置git出现Can‘t run a Git command in the safe mode、取消受信任项目功能
git
DN金猿19 小时前
git 问题 --- fatal: detected dubious ownership in repository at
git
江木12321 小时前
Git常用命令(记录)
git
程序猿看视界1 天前
Halo 开发者指南——项目运行、构建
git·docker·node.js·pnpm·idea·openjdk·halo