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

相关推荐
shughui4 小时前
2026Git 下载、安装、使用完整教程(附安装包)
git·github·代码仓库
Moshow郑锴11 小时前
Git如何上传目录到github项目进行初始化
git
春日见21 小时前
GIT操作大全(个人开发与公司开发)
开发语言·驱动开发·git·matlab·docker·计算机外设·个人开发
Ama_tor21 小时前
将本地的 Electron 项目上传到 Gitee(码云)的 Git 操作流程
git·electron·gitee
笑鸿的学习笔记1 天前
git笔记之--abort和--quit参数详解
笔记·git
Z.风止1 天前
Large Model-learning(1)
开发语言·笔记·git·python·学习
Be for thing1 天前
分支管理与冲突解决
git·学习
极地星光1 天前
从零到一搭建 **多仓库项目(Repo Manager 架构)** 完整步骤
git·架构
原来是猿1 天前
进程间通信(三):命名管道
linux·服务器·网络·git
幸福从心动开始1 天前
脱单不是拖,爱要主动说——写给还在“git commit -m ‘等缘分’”的程序员
git