Re: [PATCH v3 5/5] builtin/refs: add "rename" subcommand
From: Toon Claes <hidden>
Date: 2026-07-03 14:31:54
Patrick Steinhardt [off-list ref] writes:
quoted hunk ↗ jump to hunk
Add a "rename" subcommand to git-refs(1) with the syntax: $ git refs rename <oldref> <newref> It renames <oldref> together with its reflog to <newref>; even when used on a local branch ref, the current value and the reflog of the ref are the only things that are renamed. Document it and redirect casual users to "git branch -m" if that is what they wanted to do. Co-authored-by: Junio C Hamano [off-list ref] Signed-off-by: Patrick Steinhardt <redacted> --- Documentation/git-refs.adoc | 6 ++ builtin/refs.c | 49 +++++++++++++++++ t/meson.build | 1 + t/t1467-refs-rename.sh | 131 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 187 insertions(+)diff --git a/Documentation/git-refs.adoc b/Documentation/git-refs.adoc index e6a3528349..ce278c59bf 100644 --- a/Documentation/git-refs.adoc +++ b/Documentation/git-refs.adoc@@ -23,6 +23,7 @@ git refs optimize [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude git refs create [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value> git refs delete [--message=<reason>] [--no-deref] <ref> [<old-value>] git refs update [--message=<reason>] [--no-deref] [--create-reflog] <ref> <new-value> [<old-value>] +git refs rename [--message=<reason>] <old-ref> <new-ref>
So symrefs cannot be renamed with this command? -- Cheers, Toon