git mv -k <path> <path>
This command is useful when you want Git to track a move or rename of files or directories while avoiding interruptions from problematic paths. It updates the working directory and index so the move/rename is recorded as a staged change for the next commit.
The first <path> is the source file or directory you want to move or rename, and the second <path> is the destination path or new name. The -k flag (same as --dry-run for other commands, but here -k stands for "keep going") tells Git to continue processing all given paths, silently skipping any that would result in an error (for example, missing sources or conflicting destinations) instead of stopping the entire operation.
Related: Use git mv <path> <path> without -k to stop immediately if any move would fail, or git status afterward to review which renames and moves have been staged.
Examples:
git mv -k src/old-module.js src/new-module.jsgit mv -k docs/old-name.md docs/guide/new-name.mdgit mv -k images/logo-old.png assets/images/logo.png