E.g. Repo root: /var/lib/mercurial-server/repos
- Go to your home directory (C:\Users<username> on Windows)
- Edit the mercurial config file (mercurial.ini on windows, .hgrc on linux)
- If no [extensions] section exists in the config file, add it
- In the [extensions] section, add the line largefiles = .
- Save your changes & quit your editor
For example
[extensions]
progress =
convert =
largefiles =
- Open Sourcetree
- Open the general sourcetree settings
- Open the mercurial tab. You should see a list of extensions with checkboxes. Check the "largefiles" box, and save your changes
cd new_repo
hg init
hg add --large .
hg commit -m "Init commit"
hg clone . ssh://[email protected]/new_repo
hg clone ssh://[email protected]/existing_repo
To add files to the repo you need to use the --large argument, or they'll just go into the repo as a normal files (which is what you don't want). You can get the initial setup going by moving the files you want to track into place and add them all like so:
C:\repos\new_repo> hg add --large .
Remember that the repo will store revisions of your files, so it's best not to use directories to segregate data versions. Lay out the data as you want to use it, and use commits and tagging to manage revisions. Once you have a batch of files set up you can commit them just like in any other repo:
C:\repos\new_repo> hg commit -m "some commit message goes here"
Once you have added the files, you can modify them like as you will and they will automatically be included in the next commit, just like you would with source files. And to upload them to the server you just push like normal:
C:\repos\new_repo> hg push
To retrieve files, you can either clone the repository as described above, or just pull the changes like in a normal repository:
C:\repos\new_repo> hg pull
Hg largefiles is set up so that it will only pull down the large files that you actually need for the revision you're using, so that if you have half a dozen revisions of the file it will only get the copy of the file referenced by the commit rather than all the revisions, which is nice.