Running filter-branch over a range of commits

前端 未结 8 1340
夕颜
夕颜 2020-12-02 14:26
git filter-branch --env-filter \'
export GIT_AUTHOR_EMAIL=\"foo@example.com\"
export GIT_AUTHOR_NAME=\"foo\"\' -- commita..commitb

Results in

8条回答
  •  甜味超标
    2020-12-02 14:58

    git filter-branch does accept range notation, but the end of the range needs to be a reference, not the ID of a commit.

    git checkout -b tofilter commitb
    git filter-branch .... commita..tofilter
    

    If given just commits, it would not know what ref to update with the filtered branch.

提交回复
热议问题