Documentation Index
Fetch the complete documentation index at: https://mintlify.com/newren/git-filter-repo/llms.txt
Use this file to discover all available pages before exploring further.
Reference Renaming Options
Options for renaming Git references including branches and tags.Tag Renaming
—tag-rename
Rename tags by replacing prefix.Format:
OLD:NEWApplies to: Tag names only (use --refname-callback for branches)Empty values: Either OLD or NEW can be emptyHow it works:- Matches tags starting with
OLDprefix - Replaces the
OLDprefix withNEWprefix - Rest of tag name remains unchanged
Common Use Cases
Preparing for Repository Merge
When merging repositories, avoid tag name conflicts:Standardizing Tag Format
Removing Tag Prefix
Adding Organization Prefix
Advanced Tag Renaming
Multiple Tag Rename Rules
Apply multiple renames sequentially:Pattern-Based Tag Renaming
For complex tag renaming, use--refname-callback:
Branch Renaming
--tag-rename only affects tags. To rename branches, use --refname-callback.Rename Branches with Callback
Reference Format
Git references use the following format:- Tags:
refs/tags/tagname - Branches:
refs/heads/branchname - Remote branches:
refs/remotes/origin/branchname
Tag Rename Behavior
--tag-rename automatically handles the refs/tags/ prefix:
Interaction with —partial
With--partial flag, behavior changes:
Usage Examples
Prepare for Monorepo Merge
Convert Tag Convention
Namespace Tags by Environment
Verification
Verify tag renames:Important Notes
Lightweight vs Annotated TagsTag renaming works for both lightweight and annotated tags. The tag message and metadata are preserved for annotated tags.
Tag Rename Safety
Tag renaming is permanent and affects all tag references:- Old tag names are removed
- New tag names point to the same commits (rewritten)
- Annotated tag messages are preserved
- Tag signatures are removed (history rewrite invalidates signatures)
Limitations
No Wildcard Support
--tag-rename doesn’t support wildcards:
--refname-callback for pattern matching.
Prefix Matching Only
Only prefix replacement is supported:Single Rename Rule
Multiple--tag-rename options not supported:
See Also
- Callbacks → - Custom ref renaming with
--refname-callback - Commit Options → - Modify commits
- Path Options → - Filter and rename paths
- Examples → - Real-world examples
