AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

🚨 重要公告:Git 历史重写,需重新同步仓库

Open Soulter opened this issue 9 months ago • 0 comments

为了让项目和社区更好地运作,在刚刚,我们使用了 git-filter-repo 工具清除了此仓库历史中的某些敏感数据。该操作不可避免地 重写了所有 Git commit 历史(Commit 作者未变),因此您的本地仓库副本可能已失效,需要进行相应的更新。

影响范围

所有历史提交的哈希值已发生变化,旧的 commit ID 不再有效。 所有分支、标签已被重写,请勿直接基于旧版本进行推送或合并。 已克隆的本地仓库副本 将与远程仓库存在冲突,必须重新同步。

解决方案

如果您本地已有该仓库的克隆版本,请执行以下操作以重新同步:

git fetch --all
git reset --hard origin/master  # 请确保切换到正确的主分支
git clean -df  # 可选:清理未跟踪的文件

⚠ 注意:此操作将 重置本地所有未提交的更改,请先备份您的工作内容!

后续步骤

未来的提交请基于最新的远程仓库进行开发。 如有任何问题,请在此 Issue 下留言。

感谢您的理解与配合!


We have just used the git-filter-repo tool to remove certain sensitive data from the repository's history. This operation has rewritten the entire Git commit history, which means your local repository copy may no longer be valid and needs to be updated.

Impact

All historical commit hashes have changed, and old commit IDs are no longer valid. All branches and tags have been rewritten, so please avoid pushing or merging based on old references. Existing cloned local repositories will conflict with the updated remote repository and must be resynchronized.

What You Need to Do

If you have already cloned this repository, please run the following commands to resynchronize:

git fetch --all
git reset --hard origin/master  # Make sure to switch to the correct main branch
git clean -df  # Optional: Clean untracked files

⚠ Warning: This operation will reset all uncommitted changes, so please back up your work before proceeding!

Next Steps

Ensure that all future commits are based on the latest remote repository. If you need to reference old commits, please confirm the new commit IDs with the team. If you encounter any issues, feel free to leave a comment on this issue or contact the repository maintainers.

Thank you for your understanding and cooperation!

相关文档

  • https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository

Soulter avatar Mar 07 '25 02:03 Soulter