Skip to content

Commit 12743de

Browse files
committed
git-filter-repo.txt: add some clarifications around replace refs
Signed-off-by: Elijah Newren <[email protected]>
1 parent 8683d6f commit 12743de

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

Documentation/git-filter-repo.txt

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ can be overridden, but they are all on by default):
5555
handles edge cases like pruning of merge commits which become
5656
degenerate and empty)
5757
* creating replace-refs (see linkgit:git-replace[1]) for old commit
58-
hashes, which if pushed and fetched will allow users to continue to
59-
refer to new commits using (unabbreviated) old commit IDs
58+
hashes, which if manually pushed and fetched will allow users to
59+
continue to refer to new commits using (unabbreviated) old commit
60+
IDs
6061
* stripping of original history to avoid mixing old and new history
6162
* repacking the repository post-rewrite to shrink the repo for the
6263
user
@@ -568,15 +569,23 @@ history rewrite are roughly as follows:
568569

569570
* filter-repo by default creates replace refs (see
570571
linkgit:git-replace[1]) for each rewritten commit ID, allowing
571-
you to use old (unabbreviated) commit hashes to refer to the
572-
newly rewritten commits. If you want to use these replace refs,
573-
push them to the relevant clone URL and tell users to adjust
574-
their fetch refspec (e.g. `git config --add remote.origin.fetch
575-
+refs/replace/*:refs/replace/*`) Sadly, some existing git servers
576-
(e.g. Gerrit, GitHub) do not yet understand replace refs, and
577-
thus one can't use old commit hashes within their UI; this may
578-
change in the future. But replace refs at least help users
579-
locally within the git CLI.
572+
you to use old (unabbreviated) commit hashes in the git command
573+
line to refer to the newly rewritten commits. If you want to use
574+
these replace refs, manually push them to the relevant clone URL
575+
and tell users to manually fetch them (e.g. by adjusting their
576+
fetch refspec, `git config --add remote.origin.fetch
577+
+refs/replace/*:refs/replace/*`). Sadly, replace refs are not
578+
yet widely understood; projects like jgit and libgit2 do not
579+
support them and existing repository managers (e.g. Gerrit,
580+
GitHub, GitLab) do not yet understand replace refs. Thus one
581+
can't use old commit hashes within the UI of these other systems.
582+
This may change in the future, but replace refs at least help
583+
users locally within the git command line interface. Also, be
584+
aware that commit-graphs are excessively cautious around replace
585+
refs and just turn off entirely if any are present, so after
586+
enough time has passed that old commit IDs become less relevant,
587+
users may want to locally delete the replace refs to regain the
588+
speedups from commit-graphs.
580589

581590
* If you have a central repo, you may want to prevent people
582591
from pushing old commit IDs, in order to avoid mixing old

0 commit comments

Comments
 (0)