git filter-repo
A versatile tool for rewriting Git history. See also:
bfg. More information: https://github.com/newren/git-filter-repo.
- Replace a sensitive string in all files:
git filter-repo --replace-text <(echo '==>')
- Extract a single folder, keeping history:
git filter-repo --path
- Remove a single folder, keeping history:
git filter-repo --path --invert-paths
- Move everything from sub-folder one level up:
git filter-repo --path-rename /:
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
