{
    "content": [
        {
            "type": "text",
            "text": "# git-mv (man)\n\n## NAME\n\ngit-mv - Move or rename a file, a directory, or a symlink\n\n## SYNOPSIS\n\ngit mv <options>... <args>...\n\n## DESCRIPTION\n\nMove or rename a file, directory or symlink.\n\n## TLDR\n\n> Move or rename files and update the Git index.\n\n- Move a file inside the repo and add the movement to the next commit:\n  `git mv {{path/to/file}} {{path/to/destination}}`\n- Rename a file or directory and add the renaming to the next commit:\n  `git mv {{path/to/file_or_directory}} {{path/to/destination}}`\n- Overwrite the file or directory in the target path if it exists:\n  `git mv {{-f|--force}} {{path/to/file_or_directory}} {{path/to/destination}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **SUBMODULES**\n- **BUGS**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-mv",
        "section": "",
        "mode": "man",
        "summary": "git-mv - Move or rename a file, a directory, or a symlink",
        "synopsis": "git mv <options>... <args>...",
        "tldr_summary": "Move or rename files and update the Git index.",
        "tldr_examples": [
            {
                "description": "Move a file inside the repo and add the movement to the next commit",
                "command": "git mv {{path/to/file}} {{path/to/destination}}"
            },
            {
                "description": "Rename a file or directory and add the renaming to the next commit",
                "command": "git mv {{path/to/file_or_directory}} {{path/to/destination}}"
            },
            {
                "description": "Overwrite the file or directory in the target path if it exists",
                "command": "git mv {{-f|--force}} {{path/to/file_or_directory}} {{path/to/destination}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-f",
                "long": "--force",
                "arg": null,
                "description": "Force renaming or moving of a file even if the target exists"
            },
            {
                "flag": "-k",
                "long": null,
                "arg": null,
                "description": "Skip move or rename actions which would lead to an error condition. An error happens when a source is neither existing nor controlled by Git, or when it would overwrite an existing file unless -f is given."
            },
            {
                "flag": "-n",
                "long": "--dry-run",
                "arg": null,
                "description": "Do nothing; only show what would happen"
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Report the names of files as they are moved."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-f, --force",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "-k",
                        "lines": 4,
                        "flag": "-k"
                    },
                    {
                        "name": "-n, --dry-run",
                        "lines": 2,
                        "flag": "-n",
                        "long": "--dry-run"
                    },
                    {
                        "name": "-v, --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    }
                ]
            },
            {
                "name": "SUBMODULES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-mv - Move or rename a file, a directory, or a symlink\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git mv <options>... <args>...\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Move or rename a file, directory or symlink.\n\ngit mv [-v] [-f] [-n] [-k] <source> <destination>\ngit mv [-v] [-f] [-n] [-k] <source> ... <destination directory>\n\nIn the first form, it renames <source>, which must exist and be either a file, symlink or\ndirectory, to <destination>. In the second form, the last argument has to be an existing\ndirectory; the given sources will be moved into this directory.\n\nThe index is updated after successful completion, but the change must still be committed.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-f, --force",
                        "content": "Force renaming or moving of a file even if the target exists\n",
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "-k",
                        "content": "Skip move or rename actions which would lead to an error condition. An error happens when\na source is neither existing nor controlled by Git, or when it would overwrite an\nexisting file unless -f is given.\n",
                        "flag": "-k"
                    },
                    {
                        "name": "-n, --dry-run",
                        "content": "Do nothing; only show what would happen\n",
                        "flag": "-n",
                        "long": "--dry-run"
                    },
                    {
                        "name": "-v, --verbose",
                        "content": "Report the names of files as they are moved.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    }
                ]
            },
            "SUBMODULES": {
                "content": "Moving a submodule using a gitfile (which means they were cloned with a Git version 1.7.8 or\nnewer) will update the gitfile and core.worktree setting to make the submodule work in the\nnew location. It also will attempt to update the submodule.<name>.path setting in the\ngitmodules(5) file and stage that file (unless -n is used).\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Each time a superproject update moves a populated submodule (e.g. when switching between\ncommits before and after the move) a stale submodule checkout will remain in the old location\nand an empty directory will appear in the new location. To populate the submodule again in\nthe new location the user will have to run \"git submodule update\" afterwards. Removing the\nold directory is only safe when it uses a gitfile, as otherwise the history of the submodule\nwill be deleted too. Both steps will be obsolete when recursive submodule update has been\nimplemented.\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                                    GIT-MV(1)",
                "subsections": []
            }
        }
    }
}