|
5 | 5 | * [Why did `git-filter-repo` rewrite commit hashes?](#why-did-git-filter-repo-rewrite-commit-hashes)
|
6 | 6 | * [Why did `git-filter-repo` rewrite more commit hashes than I expected?](#why-did-git-filter-repo-rewrite-more-commit-hashes-than-i-expected)
|
7 | 7 | * [Why did `git-filter-repo` rewrite other branches too?](#why-did-git-filter-repo-rewrite-other-branches-too)
|
| 8 | + * [How should paths be specified?](#How-should-paths-be-specified) |
8 | 9 | * [Help! Can I recover or undo the filtering?](#help-can-i-recover-or-undo-the-filtering)
|
9 | 10 | * [Can you change `git-filter-repo` to allow future folks to recover from `--force`'d rewrites?](#can-you-change-git-filter-repo-to-allow-future-folks-to-recover-from---forced-rewrites)
|
10 | 11 | * [Can I use `git-filter-repo` to fix a repository with corruption?](#Can-I-use-git-filter-repo-to-fix-a-repository-with-corruption)
|
@@ -90,6 +91,42 @@ comes with the risk that one branch now has a different version of some
|
90 | 91 | commits than other branches do; usually, when you rewrite history, you
|
91 | 92 | want all branches that depend on what you are rewriting to be updated.
|
92 | 93 |
|
| 94 | +## How should paths be specified? |
| 95 | + |
| 96 | +Arguments to `--path` should be paths as Git would report them, when run |
| 97 | +from the toplevel of the git repository (explained more below after some |
| 98 | +examples). |
| 99 | + |
| 100 | +**Good** path examples: |
| 101 | + * `README.md` |
| 102 | + * `Documentation/README.md` |
| 103 | + * `src/modules/flux/capacitor.rs` |
| 104 | + |
| 105 | +You can find examples of valid path names from your repository by |
| 106 | +running either `git diff --no-relative --name-only` or `git log |
| 107 | +--no-relative --name-only --format=""`. |
| 108 | + |
| 109 | +The following are basic rules about paths the way that Git reports and uses |
| 110 | +them: |
| 111 | + * do not use absolute paths |
| 112 | + * always treats paths as relative to the toplevel of the repository |
| 113 | + (do not add a leading slash, and do not specify paths relative to some |
| 114 | + subdirectory of the repository even if that is your current working |
| 115 | + directory) |
| 116 | + * do not use the special directories `.` or `..` anywhere in your path |
| 117 | + * do not use `\`, the Windows path separator, between directories and |
| 118 | + files; always use `/` regardless of platform. |
| 119 | + |
| 120 | +**Erroneous** path examples (do **_NOT_** use any of these styles): |
| 121 | + * `/absolute/path/to/src/modules/program.c` |
| 122 | + * `/src/modules/program.c` |
| 123 | + * `src/docs/../modules/main.java` |
| 124 | + * `scripts/config/./update.sh` |
| 125 | + * `./tests/fixtures/image.jpg` |
| 126 | + * `../src/main.rs` |
| 127 | + * `C:\absolute\path\to\src\modules\program.c` |
| 128 | + * `src\modules\program.c` |
| 129 | + |
93 | 130 | ## Help! Can I recover or undo the filtering?
|
94 | 131 |
|
95 | 132 | Sure, _if_ you followed the instructions. The instructions told you to
|
|
0 commit comments