Mercurial: Creating a Repository

  • Go to the directory you wish to create a repository for.
  • Initialize the directory to be Hg-aware.
% hg init
  • Set up your .hgignore.
syntax: glob
  • Add the files to the working set. Hg is much faster than THG here, but THG has better functionality to help you amend your ignore file.
% hg add
  • Commit this as your initial commit.
% hg commit -m "Initial Commit"
  • If you want to (http) serve the repository and allow unauthenticated pushes, you need to create an hgrc in the .hg directory with the following contents:
allow_push = *
push_ssl = false
  • Start serving the repository.
% hg serve
listening at (bound to *:8000)

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply