速查git命令(大部分常用功能)

创建仓库

git init

git clone <url> directory

基本语句

git add file/directory

git add *.java

git status

git diff

git commit

git reset HEAD file

取消缓存内容

git rm <file>

git rm -f <file> 强制删除(+暂存)

git rm --cached <file> 删除缓存

git rm -r * 递归

git mv

重命名

分支管理

git branch

查看分支

git branch branchname

创建分支

git checkout branchname

切换到该分支

git checkout -b branchname

创建并切换

git merge branchname

将分支合并到当前分支

git branch -d

版本管理

git log

  • --oneline :查看历史记录的简洁版本
  • --graph :查看历史中什么时候出现了分支、合并
  • --reverse :逆向显示所有日志
  • --author :查找指定用户的提交日志
  • --since、--before、 --until、--after: 指定帅选日期
  • --no-merges :选项以隐藏合并提交

git tag -a vx.x

git tag -a vx.x d6f7147

远程仓库

git remote add alias url

git remote

git fetch url

git merge test/master

git pull url

git push

git remote rm

#工具

相关推荐
tianyuanwo5 小时前
当提交标题重复阻塞CI:Git分支修复实战
git·ci/cd·分支基线调整
Salt & Light5 小时前
Git 分支操作与恢复完整记录
git
重生的黑客6 小时前
从远程仓库到企业级协作:Git push、pull、PR、多人开发与分支模型
git·分支·多人协作
tianyu2348 小时前
Git 常用命令完整手册
git·版本控制·常用命令
gwf2161 天前
SSD读写速度深度解析:顺序读写vs随机读写、IOPS、延迟,你的硬盘性能到底怎么看?
git·嵌入式硬件·缓存·github·智能硬件
西邮彭于晏1 天前
图文详解:Git分支创建、合并与冲突解决|新手零门槛完整教程
大数据·git·elasticsearch
nuisthou1 天前
git常用命令总结
git
西邮彭于晏1 天前
Git 标签(Tag)与版本发布完整指南|附全场景命令速查表
大数据·git·elasticsearch
潘正翔1 天前
k8s进阶_Harbor镜像仓库
git·云原生·容器·kubernetes·gitee·github
InfinitePlus1 天前
Git基本操作-命令行
git