Git does not track files, but it tracks content that happens to be stored in files. This is the cause why you cannot track empty directories, as there is no content inside them, just files and also the cause why there is no explicit copy or rename tracking in git. Renames and copies are determined dynamically in git and in the commands that could be interested like git log
or git diff
, you can control whether renames and copies are detected and how much change in a file is still considered a rename or copy. The git mv
operation is just a convenience synonym for the deletion of the old file and addition of the new file.