smithery.ai

git-move

Move or rename files using git mv to preserve history. Use this when moving files, renaming files, or reorganizing code structure. Always prefer git mv over regular mv or filesystem operations.

First seen Apr 11, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,956 B
  • docs SUMMARY.md 209 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Git Move Skill

Move or rename files using git mv to preserve git history and ensure proper staging.

When to Use

  • Moving files between directories
  • Renaming files
  • Reorganizing code structure
  • Refactoring file locations

Instructions

ALWAYS use git mv instead of regular file move operations when working in a git repository.

Basic Usage

# Move a file
git mv <source> <destination>

# Examples
git mv src/old-component.tsx src/components/new-component.tsx
git mv app/page.tsx app/(home)/page.tsx
git mv utils.ts lib/utils.ts

Moving Multiple Files

# Move all files matching a pattern
git mv src/utils/*.ts lib/utils/

# Move entire directory
git mv old-directory/ new-directory/

Benefits Over Regular mv

  1. Preserves history: Git tracks the file rename
  2. Auto-stages: Change is automatically staged for commit
  3. Safe operation: Fails if destination exists (prevents overwrites)
  4. Works with git status: Shows as renamed, not deleted+added

Examples

Rename a Component

git mv components/OldButton.tsx components/Button.tsx

Reorganize Directory Structure

# Create target directory first if needed
mkdir -p components/ui

# Move files
git mv components/button.tsx components/ui/button.tsx
git mv components/input.tsx components/ui/input.tsx

Move with Force (Overwrite)

# Use -f to overwrite existing destination (use carefully)
git mv -f source.ts destination.ts

Important Notes

  • After moving, update all import statements that reference the old path
  • Run type checking (pnpm tsc --noEmit) to find broken imports
  • Consider using an IDE refactoring tool for imports if available