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

相关推荐
摆烂z11 小时前
AI同时完成多个功能(Git WorkTree)
git
___波子 Pro Max.16 小时前
Git Worktree 可视化理解指南
git
happymaker062618 小时前
git使用快速入门
git
不做超级小白18 小时前
从零到可用:在手机上用 Termux + Git + Obsidian 打造稳定同步环境(踩坑全记录)
git·智能手机
凡客丶18 小时前
Git安装与使用保姆教程【超详细】
git
android_cai_niao18 小时前
给Git项目添加多个远程仓库
git·gitee·github
胡小禾19 小时前
多账号下git自动切号
git
zhensherlock19 小时前
Protocol Launcher 系列:Working Copy 提交与同步全攻略
javascript·git·typescript·node.js·自动化·github·js
前端若水19 小时前
Git 全命令超级详细指南
大数据·git·elasticsearch
SiYuanFeng1 天前
新手学Git:如何把本地 Git 项目上传到 GitHub
git·github