What does git filter-branch with no arguments do?

前端 未结 3 1332
无人及你
无人及你 2021-01-13 11:41

What does git filter-branch with no arguments do?

I ran this on my repo accidentally hitting enter prematurely.

3条回答
  •  星月不相逢
    2021-01-13 12:00

    Filter-branch inspects and does any needed rewriting of the commits output by a git rev-list fed the arguments it passes along. With no arguments to pass along, rev-list uses HEAD, your current checkout.

    Along with any modifications you specify on the command line, filter-branch also bakes in local overrides from .git/info/grafts and git replace.

    So to orphan the current checkout you can git rev-parse @ >.git/info/grafts; git filter-branch

提交回复
热议问题