<?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 ByF (BaiFan) · 每日深度思考</title><link>https://blog.baifan.site/tags/git/</link><description>Recent content in Git on ByF (BaiFan) · 每日深度思考</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>blog@baifan.site (ByF (BaiFan))</managingEditor><webMaster>blog@baifan.site (ByF (BaiFan))</webMaster><copyright>CC BY-NC 4.0</copyright><lastBuildDate>Fri, 09 Oct 2026 15:15:00 +0800</lastBuildDate><atom:link href="https://blog.baifan.site/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>git add 返回 0 却拒绝暂存：一次 Git 索引 Stat Cache 幽灵故障排查</title><link>https://blog.baifan.site/git-add-silent-failure-stat-cache-plumbing/</link><pubDate>Fri, 09 Oct 2026 15:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/git-add-silent-failure-stat-cache-plumbing/</guid><description>&lt;p&gt;在写自动化脚本或终端操作 Git 时，大家习惯认为：只要 &lt;code&gt;git add&lt;/code&gt; 没报错、退出码是 0，改动就一定进暂存区了。但今天在提交博客作者配置时，碰到了一个非常诡异的静默失败：文件改动清清楚楚，&lt;code&gt;git diff&lt;/code&gt; 能正常输出改动内容，执行 &lt;code&gt;git add&lt;/code&gt; 也正常返回 0，但紧接着跑 &lt;code&gt;git status&lt;/code&gt;，文件依然显示未暂存，&lt;code&gt;git diff --cached&lt;/code&gt; 什么都没有。&lt;/p&gt;</description></item></channel></rss>