HomeToolsAbout

Move or Rename

Rule

Always prefer rename over deletion when moving files

For example, without using rename, file rename will register as a deletion and addition of file

  • With rename, the addition and deletion is combined as a single action of renaming path

Use git mv as first class

  • Has built-in safeties.

Renaming files

git mv old_name new_name

Moving file

git mv old_path/file_name new_path/file_name

Move files in a directory to new location

git mv old_path/folder_name/* new_path/folder_name/.
AboutContact