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 小时前
Git提交中的perf和chore是什么?
git
Fly feng2 小时前
git rebase 变基操作教程
git
laoliu19963 小时前
开源 FRP GUI 客户端
git·开源·github
YanaDH5 小时前
前端开发新机环境部署(带链接)
git·vscode·npm·node.js
微尘hjx6 小时前
【GitHub 代码仓 03】Git + GitHub 实战速查手册
git·github
艺杯羹19 小时前
Git版本控制深度复盘:从入门到精通的完整指南
git·wpf·版本控制·git学习·git复盘
菩提小狗20 小时前
第7天:信息打点-资产泄漏&CMS识别&Git监控&SVN&DS_Store&备份|【小迪安全】web安全|渗透测试|网络安全-2021
git·安全·svn
Ghost Face...1 天前
嵌入式Linux开发Git实战:从认证到Gerrit推送
linux·git·elasticsearch
LeoZY_1 天前
开源项目精选: lazygit —— 告别繁琐命令,终端里玩转可视化Git
git·stm32·单片机·mcu·开源·远程工作·gitcode
黎潇lulu1 天前
IDEA的Git使用方法(中文IDEA版)
java·git·intellij-idea