A helpful Windows utility for temporarily renaming files and directories (including symlinks) to enable operations such as 'git pull' without conflicts, then restoring the original names. Features full support for UNC paths, network shares, and subst drives.
- Temporary Renaming: Safely rename files/directories with
.temp_renamesuffix - Symlink Support: Handle symbolic links with configurable behavior
- UNC Path Support: Full support for network paths and mapped drives with UNCtools.
- Backup & Restore: JSON-based mapping for reliable restoration
- Progress Tracking: Real-time progress reporting for large operations
- Conflict Resolution: Smart handling of naming conflicts
- Cross-Platform: Designed for Windows with network share support
# Clone the repository
git clone https://github.com/djdarcy/temp-renamer.git
cd temp-renamer
# Install dependencies (if any)
pip install -r requirements.txt-
Temporarily rename problematic symlink directories:
python temp_renamer.py -i "C:\myproject\models" -d 0 --mode rename --file-type symlink_directory -
Restore original names:
python temp_renamer.py -i "C:\myproject\models" -d 0 --mode restore --file-type symlink_directory -
Full restore (if multiple renames occurred):
python temp_renamer.py -i "C:\myproject\models" -d 0 --mode restore --full-restore --file-type symlink_directory
--yes: Automatically confirm prompts--quiet: Suppress non-essential output--debug-symlinks: Print extra debug info for symlink resolution--rename-link {self,target}: Choose whether to rename symlink or target--allow-multiple: Allow multiple renamings of already renamed items
Perfect for AI model directories where symlinks cause git conflicts:
# Create symlinks (example from test-create.bat)
mklink /D checkpoints "c:\models\Stable-diffusion"
mklink /D vae "c:\models\VAE"
mklink /D loras "c:\models\Lora"
mklink /D controlnet "c:\models\ControlNet"
# Before git pull, temporarily rename
python temp_renamer.py -i . -d 0 --mode rename --file-type symlink_directory
# Do your git operations
git pull
# Restore original names
python temp_renamer.py -i . -d 0 --mode restore --file-type symlink_directoryThe tool uses JSON files to store rename mappings:
rename_mapping.json: Current mapping of renamed itemsconfig/: Directory for persistent configuration
Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines. Please feel free to open issues or submit pull requests.
Like the project?
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Copyright (C) 2025 Dustin Darcy - ScarcityHypothesis.org
Special thanks to the AI/ML community for inspiring this tool's creation to handle model directory symlinks.