Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving hg repo folder using copy-paste?

I have a hg repo on my local drive. I am new to hg and want to know if i can move the folder around freely. I am not talking about a folder under version control, i am talking about the folder that contains the repo it self.

I've found a lot of similar questions but most seem to be talking about a folder under version control. another answer is to use hg clone but i want to know if i can just cut and paste the whole repo.

I am using windows xp if that matters.

like image 344
Samuel Avatar asked Jul 21 '11 11:07

Samuel


1 Answers

Yes, you can copy the repository itself by just copying the .hg folder.

Imagine the following folder structure:

MyRepo
MyRepo\.hg
MyRepo\file_under_version_control.txt

MyRepo is the whole repository (or as you called it, "folder under version control").

When you remove the .hg folder from it, MyRepo is just a normal folder without version control.

When you move the .hg folder somewhere else, you can create a new working directory by running hg update, so the new folder where .hg resides will be a complete repository again.

like image 200
Christian Specht Avatar answered Sep 28 '22 13:09

Christian Specht