Rename Directory Utility - Quick Reference¶
Basic Usage¶
Common Examples¶
Rename a Project¶
Rebrand Application¶
Reorganize Workspace¶
Pre-Flight Checklist¶
✅ Source directory exists ✅ Target directory doesn't exist ✅ Parent directory has write permissions ✅ Related Docker containers are identified ✅ Git repository status is checked ✅ Uncommitted changes are reviewed
Interactive Prompts¶
- Stop Docker containers? (if found)
-
Recommended:
yes -
Continue with uncommitted changes? (if found)
- Review changes first
-
Commit or stash changes if possible
-
Create backup?
- Recommended:
yes(especially for important projects) - Backup location:
<source>-backup-YYYYMMDD-HHMMSS
What Gets Preserved¶
✅ Git repository and history
✅ File permissions and ownership
✅ Directory structure
✅ All file contents
✅ Hidden files (.git, .env, etc.)
Post-Rename Actions¶
VS Code¶
- Close workspace
- Open new location:
code <new-path>
Terminal Sessions¶
Git Remote URLs (if applicable)¶
Docker Containers¶
Common Issues¶
"Target directory already exists"¶
"Permission denied"¶
Git repository issues¶
# Check git status first
cd <source-path>
git status
# Commit changes
git add .
git commit -m "Checkpoint before rename"
Backup Management¶
Check backup size¶
Remove backup (after verification)¶
Restore from backup (if needed)¶
Safety Features¶
🔒 Won't overwrite existing directories 🔒 Checks permissions before proceeding 🔒 Preserves git history and configuration 🔒 Stops Docker containers to prevent conflicts 🔒 Warns about uncommitted changes 🔒 Verifies successful rename
Tips¶
- Always create a backup for production or important projects
- Commit git changes before renaming
- Close IDEs and terminals in the source directory
- Update environment variables after rename
- Test thoroughly after rename
Getting Help¶
Return Codes¶
0- Success1- Error (check error message for details)
Tip: Add the scripts directory to your PATH for easier access: