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?
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.
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.
If you already have Mercurial installed, make sure you have version 1.7 or later. To check, enter hg --version at the command line.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With