You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行git rebase master遇文件覆盖错误,需应用小写目录至当前分支

解决方案

1. 暂存本地未提交修改(可选)

如果当前分支有未提交的本地改动,先暂存防止丢失:

git stash

2. 让Git识别目录大小写变更

由于Git在不区分大小写的系统(如macOS、Windows)中无法自动感知目录名的大小写变化,需手动重命名触发Git识别:

  • 先将大写目录临时改名:
git mv pages/Auth pages/temp_auth
  • 再改回小写目录:
git mv pages/temp_auth pages/auth
  • 提交这个重命名操作:
git commit -m "rename pages/Auth to pages/auth to match master"

3. 重新执行rebase

现在目录名与master分支一致,执行rebase:

git rebase master

4. 恢复暂存的修改(可选)

如果之前使用了git stash,现在恢复本地改动:

git stash pop

处理未跟踪文件的备选方案

如果报错中的未跟踪文件不需要保留,先删除它们再执行上述步骤:

rm -rf client/modules/activity/pages/auth

内容的提问来源于stack exchange,提问作者Lin Du

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.26 04:24:24