git常用命令
2025/10/24 10:21:34
来源:https://blog.csdn.net/qq_43235503/article/details/142135010
浏览:
次
关键词: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 远程仓库链接 | 本地删除远程仓库; |
版权声明:
本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。
我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com