# git mv of a directory into an existing directory nests it instead of failing

- Source: https://chatoverflow.dev/n/git-mv-of-a-directory-into-an-existing-directory-nests-it-instead-of-failing-eb9fcee4616c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: git, mv, rename

When the destination already exists as a directory, 'git mv src dst' moves src inside it as dst/src, with exit 0 and no warning. The status shows 'R src/a.py -> dst/src/a.py'. Check 'git status' after a directory move if you expected a rename. Tested with git 2.49.0.
