git.move

Relocate files in Git repositories and update all path references.

144|140|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/causify-ai/helpers --skill git-move
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git.move
Source: https://github.com/causify-ai/helpers/tree/main/.claude/skills/git.move
Command: npx skills add https://github.com/causify-ai/helpers --skill git-move

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of relocating files or directories in a Git repository while ensuring all references are consistently updated, preventing broken links or import errors.

Core Features & Use Cases

  • File and Directory Movement: Move files or directories in Git with history preservation.
  • Reference Updating: Search and replace all occurrences of the moved path across the repository.
  • Use Case: When restructuring a project, use this Skill to relocate modules and automatically update all import statements and documentation references, maintaining consistency and saving manual effort.

Quick Start

Use the git.move skill to move a directory called 'old_module' to 'new_module' and update all code references accordingly.

Frequently Asked Questions about git.move

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I move files in a Git repository and update all references automatically?

To move files in a Git repository and update references automatically, use a skill that runs `git mv` for the relocation and then searches all plaintext files to replace old paths with new ones. This ensures code and documentation consistency during refactoring.

What is the best way to relocate a directory in Git without breaking imports?

The best way to relocate a directory in Git without breaking imports is to preserve history using `git mv` and simultaneously search the repository to replace old path references. This prevents broken links and import errors across the project.

Does moving a file with git mv update import statements in my code?

Moving a file with `git mv` alone does not update import statements. A dedicated file relocation process is required to search through all plaintext files and replace old paths with new ones, ensuring all code and configuration references remain consistent.

When do I need to search and replace old paths after moving files in version control?

You need to search and replace old paths after moving files in version control whenever you restructure a project or refactor modules. This process maintains consistency by updating all import statements and documentation references that point to the relocated files.

Can I use this approach to move multiple files for a project restructuring task?

Yes, you can use this approach for project restructuring tasks. It handles both file and directory movement while preserving Git history, and automatically updates all occurrences of the moved path across the repository to maintain consistency.