<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on 蒋大培的博客</title><link>https://ygwa.github.io/tags/git/</link><description>Recent content in Git on 蒋大培的博客</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 01 Dec 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://ygwa.github.io/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>告别 Git 身份混乱，一个命令搞定多身份管理</title><link>https://ygwa.github.io/writings/gid-git-identity-manager/</link><pubDate>Mon, 01 Dec 2025 00:00:00 +0800</pubDate><guid>https://ygwa.github.io/writings/gid-git-identity-manager/</guid><description>&lt;p&gt;在日常开发中，我经常需要在工作项目和个人项目之间切换。每次切换项目时，都需要手动修改 Git 的用户名和邮箱配置，不仅繁琐，还容易出错。更糟糕的是，一旦忘记切换，错误的身份信息就会被永久记录在 Git 历史中，后续清理起来也很麻烦。&lt;/p&gt;
&lt;p&gt;为了解决这个问题，我开发了 &lt;code&gt;gid&lt;/code&gt; (Git Identity Manager)，一个用 Rust 编写的命令行工具，用于管理多个 Git 身份。本文将介绍这个工具的使用方法，以及在实际使用中遇到的问题和思考。&lt;/p&gt;</description></item><item><title>Git历史信息修正</title><link>https://ygwa.github.io/writings/git-history-update-by-filter-repo/</link><pubDate>Tue, 10 Dec 2024 18:16:58 +0800</pubDate><guid>https://ygwa.github.io/writings/git-history-update-by-filter-repo/</guid><description>&lt;p&gt;在日常的项目开发过程中，多人协作时难免会有开发同学因误操作，将敏感信息（如密钥、数据库密码等）提交到 Git 仓库中。如果还未推送到远端，通常可以使用 &lt;code&gt;git reset --soft&lt;/code&gt; 重新提交。但一旦推送到远端仓库，仅删除或修改文件已无法彻底擦除这些敏感信息。因为Git作为版本控制工具，会在历史纪录中保留所有的内容，不仅影响项目的安全性，还有可能会对客户的产品和终端用户产生影响。&lt;/p&gt;
&lt;p&gt;本文将从一个实际案例出发，介绍如何使用Git工具&lt;code&gt;git filter-repo&lt;/code&gt;来清理Git仓库中的敏感信息，并探讨其中的原理及其他适用场景。&lt;/p&gt;</description></item></channel></rss>