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

相关推荐
SiYuanFeng6 小时前
新手学Git:如何把本地 Git 项目上传到 GitHub
git·github
前端若水7 小时前
git回退并合并分支操作
git
程序员鱼皮12 小时前
Git WorkTree 是什么?凭什么能让 AI 编程效率翻倍?
git·ai·程序员·编程·ai编程
懵逼的小黑子15 小时前
git与远程仓库创建连接
git
前端若水15 小时前
Git 撤销与恢复完全指南(超级详细版)
大数据·git·elasticsearch
golang学习记15 小时前
Git 2.54 来了,这个新命令让我终于敢重写历史了
git·后端
其实防守也摸鱼15 小时前
AWVS下载和安装保姆级教程
linux·服务器·git
前端若水15 小时前
Git 可以做的所有操作(完整分类)
大数据·git·elasticsearch
叹一曲当时只道是寻常16 小时前
Reference 工具安装与使用教程:一条命令管理 Git 仓库引用与知识沉淀
人工智能·git·ai·开源·github
前端若水16 小时前
Git 仓库管理命令完全指南(超级详细版)
大数据·git·elasticsearch