GIT-BRANCHES-RENAME(1)

πŸ“¦ version 2025.08, in epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ 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 πŸ’–βœ¨