From CCARH Wiki
Jump to navigation Jump to search



Renaming files

To rename a file in a mercurial repository, use the rename (or mv command after the hg command. For example to rename oldfile.txt to newfile.txt, do this command:

  hg rename oldfile.txt newfile.txt

This will move the file to the new name as well as stop mercurial from monitoring the old filename and have it start monitoring the new file for changes.

Running the hg status command will display one addition and one removal to the repository:

   hg status
   A newfile.txt
   R oldfile.txt