• 首页

  • 归档

  • 清单
    标签 歌单 书单

  • 随笔

  • 图库

  • 实验室
    图床 监控 工具 tidio

  • 友人帐

  • 留言板

  • 开往

  • 关于
    日志 MAP RSS
ghostsf

Do what i love and just do it !

12月
26
技术栈

修改git历史提交信息

发表于 2019-12-26 • 字数统计 1170 • 被 1,213 人看爆

修复 git 历史提交信息
To change the name and/or email address recorded in existing commits, you must rewrite the entire history of your Git repository.

为了修改 commit 的作者邮箱地址,你必须重写整个 git 仓库历史

Warning: This action is destructive to your repository's history. If you're collaborating on a repository with others, it's considered bad practice to rewrite published history. You should only do this in an emergency.

警告: 这个操作会破坏你的仓库历史, 如果你和别人在协同开发这个仓库,重写已发布的历史记录是一个不好的操作。建议只在紧急情况操作

操作步骤:

打开 bash

Create a fresh, bare clone of your repository: (新建一个全新的仓库信息:)

git clone --bare https://github.com/user/repo.git
cd repo.git

Copy and paste the script, replacing the following variables based on the information you gathered: (在终端复制并粘贴以下脚本,并将以下的变量修改为你需要的)

OLD_EMAIL

CORRECT_NAME

CORRECT_EMAIL

脚本信息:

git-commit-change.sh

Press Enter to run the script.(按下 enter 键来运行这个脚本

Review the new Git history for errors.(校对新的 git 仓库历史)

Push the corrected history to GitHub:(将修改后的仓库历史推到远程)

git push --force --tags origin 'refs/heads/*'
Clean up the temporary clone: (删除这个仓库)

cd ..
rm -rf repo.git

分享到:
git-bundle
tar命令参数
  • 文章目录
  • 站点概览
ghostsf

ghostsf

你能抓到我么?

Github Twitter Email RSS
看爆 Top5
  • 红米AC2100路由器刷openwrt固件-160mhz-插件全-出国-去广告-多拨 21,438次看爆
  • openwrt-安装软件kernel内核版本低-cannot find dependency kernel 9,469次看爆
  • 海康威视 hikvision SDK 二次开发 6,560次看爆
  • mac微信聊天记录附件清理归档备份方案 5,940次看爆
  • 简单且高度可扩展的分布式文件系统SeaweedFS 4,921次看爆

站点已运行 00 天 00 小时 00 分 00 秒(●'◡'●)ノ♥

Copyright © 2023 ghostsf 苏ICP备15036367号

Power by Halo · Theme by July