mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
27 lines
654 B
Plaintext
27 lines
654 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# 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:
|
|
|
|
`git filter-repo --path {{path/to/folder}}`
|
|
|
|
- Remove a single folder, keeping history:
|
|
|
|
`git filter-repo --path {{path/to/folder}} --invert-paths`
|
|
|
|
- Move everything from sub-folder one level up:
|
|
|
|
`git filter-repo --path-rename {{path/to/folder}}/:`
|