Simple Path Renaming
Rename a single file throughout history:Rename Directories
Move or rename an entire directory:Include the trailing slash when renaming directories to ensure all files within are renamed correctly.
Multiple Renames
Perform several rename operations at once:Moving Root to Subdirectory
Make the entire repository root become a subdirectory:1
Clone the repository
2
Move to subdirectory
README.md) will now be at my-module/README.md.Combining Extraction and Renaming
Extract a subdirectory and rename it:- Keeps only
src/some-folder/some-feature/ - Renames it to
src/ - Removes everything else
Complex Reorganization Example
Restructure a repository layout:1
Plan the reorganization
Original structure:Desired structure:
2
Apply multiple renames
Using Paths File for Renames
For many renames, use a paths file with==> syntax:
1
Create paths file
Create
../renames.txt:2
Apply renames
Advanced: Callback-Based Renaming
For complex renaming logic, use Python callbacks:Rename by pattern
Conditional renaming
Replace path components
Renaming with Extraction
Combine path selection with renaming:Tag Renaming
Rename tags to avoid conflicts when merging:Complete Example: Repository Merge Preparation
Prepare a repository for merging by reorganizing and prefixing:1
Clone fresh
2
Extract and reorganize
- Keeps only the
src/directory - Moves everything to
modules/extracted/src/ - Prefixes all tags with
extracted-module-
3
Verify changes
