Forrest logo
back to the git tool

git-filter-repo:tldr:af691

git-filter-repo: Remove a single folder, keeping history.
$ git filter-repo --path ${path-to-folder} --invert-paths
try on your machine

This command is using the git filter-repo command to filter and modify the repository history.

Here's an explanation of each option used:

  • --path: This option specifies the path to a folder or directory within your repository. It is used to specify which files or directories should be included in the filtered repository history.

  • ${path-to-folder}: This is a placeholder that should be replaced with the actual path to the folder or directory you want to include in the filtered history.

  • --invert-paths: This option is used to invert the selection of paths. By default, git filter-repo includes the specified paths, but with this option, it will exclude the specified paths.

In summary, this command filters the repository history, excluding all files and directories except for the specified ${path-to-folder} and its contents.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool