Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git mv

Move or rename files and directories

Syntax

git mv [options] <source> <destination>

Common Options

OptionDescription
-f, --forceForce move/rename (overwrite)
-n, --dry-runDry run
-kSkip actions that would error
-v, --verboseVerbose output

Examples

git mv old.txt new.txt

Rename file

git mv file.txt src/

Move file to directory

git mv -f old.txt existing.txt

Force rename with overwrite

Related Commands

Related Tools

More Code & Dev Tools