Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hg: How to move files (to subfolder) without losing history?

How to move files (to subfolder) without losing their history?

In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from MyProject/ to MyProject/src/). How can I do it without losing all history?

like image 750
Alex P. Avatar asked Feb 26 '14 15:02

Alex P.


1 Answers

Since you have a "tortoisehg" tag, I figured I'd explain the way I do this using the GUI.

Usually, I just rename/move files in my IDE, or from windows explorer, then when I go to commit, THG will show a bunch of (?) unknown files and (R) removed files. Just right click on any of the files and choose "Detect Renames...", then click the "Find Renames" button.

You might have to adjust the "Min Similarity" slider until you get all the files you want and only the files you want, but it's usually very straightforward.

like image 95
mo. Avatar answered Nov 09 '22 02:11

mo.