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

git 怎么删除特定 commit 问题

  •  
  •   yumijie · Apr 26, 2017 · 2323 views
    This topic created in 3331 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   ·   1026 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:54 · PVG 02:54 · LAX 11:54 · JFK 14:54
    ♥ Do have faith in what you're doing.