git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
yumijie
V2EX  ›  git

git 怎么删除特定 commit 问题

  •  
  •   yumijie · Apr 26, 2017 · 2500 views
    This topic created in 3486 days ago, the information mentioned may be changed or developed.
    我有个仓库,commit 提交的都是按日期.比如今天 20170426 这样的,因为仓库越来越臃肿,我想删除 20170301 以前的一切提交怎么删除?
    本人 git 水平也就只会简单的 init,add,push 的有限的几个命令.
    SoloCompany
    SoloCompany
    Apr 26, 2017
    1
    伪代码
    git filter-branch --commit-filter '
    if [ "$GIT_AUTHOR_DATE" 小于 20170301 ];
    then
    skip_commit "$@";
    else
    git commit-tree "$@";
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2989 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:49 · PVG 08:49 · LAX 16:49 · JFK 19:49
    ♥ Do have faith in what you're doing.