GIT-BRANCHES-RENAME(1)
β¨ GIT-BRANCHES-RENAME β¨
okay bestie, so this is a page from the General Commands Manual (section 1, the main character section obviously π
) and it's all about git-branches-rename β a lil git tool that lives in the git-tools collection. buckle up, it's a short one but it ATE.
πΈ NAME πΈ
git-branches-rename β Batch renames branches with a matching prefix to another prefix
like... it goes through your branches, finds all the ones starting with one prefix, and swaps that prefix out for a new one. en masse. no cap. π₯
π SYNOPSIS π
git-branches-rename [options] BRANCH_PREFIX NEW_PREFIX
two positional args, some options, that's the whole vibe β¨
π¦ DESCRIPTION π¦
Batch renames branches with a matching prefix to another prefix.
that's it. that's the tea. it looks at your branch names, grabs every one that starts with your BRANCH_PREFIX, and renames it so it starts with NEW_PREFIX instead. one command, many branches, zero manual labor. it's giving efficiency π
π OPTIONS π
-h,--helpβ show usage information. your little "wait how does this work again" button π«Ά-v,--verboseβ print more details about what is being done. she gets chatty, she tells you everything π-n,--dry-runβ do not actually rename the branches. a lil dress rehearsal β it shows you the drama but doesn't touch your repo π
and then the two positional besties:
BRANCH_PREFIXβ a prefix that matches the start of branch names.NEW_PREFIXβ the new prefix for the branch names.
β οΈ heads up: the prefix has to match the start of the branch name. it's not out here matching random substrings in the middle, she has standards.
π EXAMPLES π
first one β renaming everything that starts with bug:
$ git-rename-branches bug bugfix
bug/128 -> bugfix/128
bug_test -> bugfix_test
see how bug/128 became bugfix/128 and bug_test became bugfix_test? the bug bit got swapped for bugfix, the rest stayed exactly where it was. periodt. β¨
second one β moving your main branches into a backup/ namespace:
$ git-rename-branches ma backup/ma
master -> backup/master
main -> backup/main
ma matches both master and main, so both got the backup/ glow-up. iconic honestly. πΈ
β SEE ALSO β
go look at the whole git-tools family, they're all lowkey slaying π¦
π AUTHOR π
Rodrigo Silva (MestreLion) linux@rodrigosilva.com
the legend herself wrote this one. respect. π
and that's a wrap on git-branches-rename(1) β this lil page came out on 2016-01-31, so yeah she's an elder but she still eats π
go rename some branches bestie, you got this πβ¨
π¦ where this page comes from
- epel 10: git-tools 2025.08-1.el10_2 Β· GPL-3.0-or-later
- epel 9: git-tools 2025.08-1.el9 Β· GPL-3.0-or-later
- fedora 43: git-tools 2025.08-1.fc43 Β· GPL-3.0-or-later
- fedora 44: git-tools 2025.08-2.fc44 Β· GPL-3.0-or-later
- nixos 26.05: git-tools 2025.08
- nixpkgs unstable: git-tools 2025.08
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms