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

git 怎么删除特定 commit 问题

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