【问题标题】:How to delete GitHub blame history?如何删除 GitHub 的责备历史?
【发布时间】:2020-01-25 03:18:47
【问题描述】:

我想删除 GitHub 显示的 GitHub 指责历史记录(跟踪所做的所有更改)

我知道如何回滚更改,但我不想回滚我所做的任何更改,我只是想删除此更改的历史。 p>

显然,我确实拥有我将在其上运行的存储库(并且是唯一所有者)

【问题讨论】:

  • 我想你可以强制推送一个将现有的所有内容压缩到一个提交的提交。
  • git blame 只是一个与 git 中的历史交互的命令。历史只是历史,而不是“责备历史”。

标签: github version-control blame git-blame


【解决方案1】:

如果这是针对您的 GitHub 存储库的 所有 文件,最简单的方法是:

  • 初始化新的本地存储库
  • 从原始仓库添加文件
  • 将原始存储库 GitHub URL 添加为远程
  • 强制推送

即:

git clone https://github.com/me/myrepo
git init myrepo2
cd repo2
git --work-tree=../myrepo add .
git checkout @ -- .
git commit -m "Import myrepo"
git remote add origin https://github.com/me/myrepo
git push --force -u origin master

【讨论】:

  • 谢谢,我试试看
猜你喜欢
  • 2011-10-26
  • 2012-11-22
  • 2011-06-06
  • 2011-05-23
  • 2023-01-22
  • 2014-07-07
  • 1970-01-01
  • 2017-04-11
  • 1970-01-01
相关资源
最近更新 更多