沧海一粟

  • 首页
  • 归档
  • 文章目录
  • 站点概览

Wisely Zou

52 日志
12 分类
24 标签
GitHub
链接
  • 半醉浮生 PT
  • Allen Hua 的网络博客
  • 天雨的博客
  • 苍穹の下

Git合并最初的两个提交

发表于 2023-11-25 更新于 2026-01-29 阅读次数:

刚初始化一个Git仓库的时候可能会有这个需求。之前尝试用rebase -i HEAD^^,报错。今天终于找到了正确的方法。

1
git rebase -i --root

然后把第二个commit的pick改成fixup,保存退出即可。

参考来源:
Combine the first two commits of a Git repository?

MCU Watch Order by Release Date (To Be Continued)
Combine the first two commits of a Git repository
© 2023 – 2026 Wisely Zou
由 Hexo & NexT.Pisces 强力驱动
0%