git 常用命令

git如何查找commit内容?

1、查找commit的comment内容,使用grep参数:

git log --grep=comment注释的关键词
2、查找用户,使用author参数

git log --author=用户名关键字

git commit -s -m "descriptions about the code"

只要加入-s参数即可自动加上Signed-off-by信息

git 查看某次commit的修改内容

具体步骤:

1、首先,需要通过git log打印所有commit记录

2、找到你想查看的那次commit的commitid。

3、查看修改。

git show commitId

4、查看某次commit中具体某个文件的修改:

git show commitId fileName

git 查看某次commit涉及到哪些分支修改----

https://blog.csdn.net/yang1349day/article/details/112171438

git branch contains commitID --all
git 查看某个修改 涉及哪些tag,可以得到最低和最高版本的支持

git tag --contains commitID

git tag --contains fef9df8b594531a4257b6a3bf7e190570c17be29 |sort -V | head -n 10

git仓库迁移后,更新本地代码关联的git地址

// 查看本地代码关联的git仓库地址

git remote -v
// 删除本地关联的git仓库地址

git remote rm origin
// 本地代码关联新的仓库地址

git remote add origin 新地址

// 再次查看本地代码关联的git仓库地址

git remote -v

相关推荐
李日灐2 小时前
< 7 > Linux 开发工具:git 版本控制器 和 cgdb/gdb 调试器
linux·运维·服务器·开发语言·git·调试器·gdb/cgdb
Gust of wind2 小时前
idea结合git和Gitee的初步使用
git·gitee·intellij-idea
夜七少eleanor3 小时前
【Git】2026全图文详解安装教程
git
海边的Kurisu3 小时前
从零开始的Git生活 | 刚实习同学的噩梦 And 参与开源不可缺的一环
git·生活
不老刘4 小时前
Git Cherry-Pick:微前端架构下的“精准医疗”与最佳实践
前端·git
爬楼的猪4 小时前
Git Folder Dashboard
git
Uncertainty!!4 小时前
claude code中添加skills自动生成git commit信息
git·git commit·claude code
FserSuN6 小时前
Git Worktree 使用学习
git·学习
Z文的博客6 小时前
嵌入式LINUX QT 开发 .gitignore 文件编写指南
linux·git·qt·elasticsearch·嵌入式
前端双越老师7 小时前
3 个命令 7 个步骤,学会 git worktree 并行开发
git·ai编程·全栈