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

相关推荐
The Straggling Crow13 小时前
熟练版本控制 (Git)、CI/CD 流程。
git·elasticsearch·ci/cd
海绵宝宝_16 小时前
Copilot 一键生成中文 Git Commit Message
git
孫治AllenSun16 小时前
【Git】分支管理
git
甲虫机16 小时前
git 常用命令
git
安果移不动16 小时前
【Git实战】记录一次分支切换失败的排查:Submodule 脏状态与强制切换
git
痕忆丶17 小时前
git 软重置的使用场景git reset --soft HEAD~1
git
杰瑞学AI18 小时前
在Git的缩写哈希中踩的坑
git
dragoooon3419 小时前
[Linux网络基础——Lesson9.「TCP 全连接队列与 tcpdump 抓包」]
前端·git·github
大、男人20 小时前
分享一个git设备代理的方法
git
悟悟悟!20 小时前
git使用笔记:git日常工作流和命名规范
笔记·git·elasticsearch