2021-12-27 16:55:08 +00:00
|
|
|
# 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 '{{find}}==>{{replacement}}')`
|
|
|
|
|
|
|
|
- Extract a single folder, keeping history:
|
|
|
|
|
2023-02-15 00:09:54 +00:00
|
|
|
`git filter-repo --path {{path/to/folder}}`
|
2021-12-27 16:55:08 +00:00
|
|
|
|
|
|
|
- Remove a single folder, keeping history:
|
|
|
|
|
2023-02-15 00:09:54 +00:00
|
|
|
`git filter-repo --path {{path/to/folder}} --invert-paths`
|
2021-12-27 16:55:08 +00:00
|
|
|
|
|
|
|
- Move everything from sub-folder one level up:
|
|
|
|
|
2023-02-15 00:09:54 +00:00
|
|
|
`git filter-repo --path-rename {{path/to/folder/:}}`
|