Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you init a new Mercurial project with a different username?

Tags:

mercurial

Normally I would do this to start a new Mercurial project:

cd /project-directory
hg init

This uses the username that is set somewhere on my machine (%USERPROFILE%\Mercurial.ini)

But on this occasion I want to initialize a project with a different username.

Is there an option to use with hg init to do this?

like image 901
Lucaz Avatar asked Feb 17 '11 17:02

Lucaz


People also ask

How do I create a Mercurial repository?

Create a local Mercurial repository Open the project you want to store in a repository. From the main menu, choose Hg | Create Mercurial Repository. Specify the location of the new repository.

What is .hg folder?

hg folder keeps track of one repo only. If you've got one in your home directory it means your home directory is under version control.

How do I know my Mercurial version?

If you already have Mercurial installed, make sure you have version 1.7 or later. To check, enter hg --version at the command line.


1 Answers

hg init doesn't use the username at all (repo starts with no changesets, at revision null). If you want to commit with a different username, use hg commit --user.

You can also set the username in the repository's hgrc (.hg/hgrc), just like you do in global one — then all commits to that repository will use it.

like image 92
Cat Plus Plus Avatar answered Sep 29 '22 02:09

Cat Plus Plus