##// END OF EJS Templates
lfs: expand the user facing documentation
Matt Harbison -
r35786:60a6ab7b default
parent child Browse files
Show More
@@ -7,29 +7,76 b''
7
7
8 """lfs - large file support (EXPERIMENTAL)
8 """lfs - large file support (EXPERIMENTAL)
9
9
10 The extension reads its configuration from a versioned ``.hglfs``
10 This extension allows large files to be tracked outside of the normal
11 configuration file found in the root of the working directory. The
11 repository storage and stored on a centralized server, similar to the
12 ``.hglfs`` file uses the same syntax as all other Mercurial
12 ``largefiles`` extension. The ``git-lfs`` protocol is used when
13 configuration files. It uses a single section, ``[track]``.
13 communicating with the server, so existing git infrastructure can be
14 harnessed. Even though the files are stored outside of the repository,
15 they are still integrity checked in the same manner as normal files.
14
16
15 The ``[track]`` section specifies which files are stored as LFS (or
17 The files stored outside of the repository are downloaded on demand,
16 not). Each line is keyed by a file pattern, with a predicate value.
18 which reduces the time to clone, and possibly the local disk usage.
17 The first file pattern match is used, so put more specific patterns
19 This changes fundamental workflows in a DVCS, so careful thought
18 first. The available predicates are ``all()``, ``none()``, and
20 should be given before deploying it. :hg:`convert` can be used to
19 ``size()``. See "hg help filesets.size" for the latter.
21 convert LFS repositories to normal repositories that no longer
22 require this extension, and do so without changing the commit hashes.
23 This allows the extension to be disabled if the centralized workflow
24 becomes burdensome. However, the pre and post convert clones will
25 not be able to communicate with each other unless the extension is
26 enabled on both.
27
28 To start a new repository, or add new LFS files, just create and add
29 an ``.hglfs`` file as described below. Because the file is tracked in
30 the repository, all clones will use the same selection policy. During
31 subsequent commits, Mercurial will consult this file to determine if
32 an added or modified file should be stored externally. The type of
33 storage depends on the characteristics of the file at each commit. A
34 file that is near a size threshold may switch back and forth between
35 LFS and normal storage, as needed.
36
37 Alternately, both normal repositories and largefile controlled
38 repositories can be converted to LFS by using :hg:`convert` and the
39 ``lfs.track`` config option described below. The ``.hglfs`` file
40 should then be created and added, to control subsequent LFS selection.
41 The hashes are also unchanged in this case. The LFS and non-LFS
42 repositories can be distinguished because the LFS repository will
43 abort any command if this extension is disabled.
20
44
21 Example versioned ``.hglfs`` file::
45 Committed LFS files are held locally, until the repository is pushed.
46 Prior to pushing the normal repository data, the LFS files that are
47 tracked by the outgoing commits are automatically uploaded to the
48 configured central server. No LFS files are transferred on
49 :hg:`pull` or :hg:`clone`. Instead, the files are downloaded on
50 demand as they need to be read, if a cached copy cannot be found
51 locally. Both committing and downloading an LFS file will link the
52 file to a usercache, to speed up future access. See the `usercache`
53 config setting described below.
54
55 .hglfs::
56
57 The extension reads its configuration from a versioned ``.hglfs``
58 configuration file found in the root of the working directory. The
59 ``.hglfs`` file uses the same syntax as all other Mercurial
60 configuration files. It uses a single section, ``[track]``.
22
61
23 [track]
62 The ``[track]`` section specifies which files are stored as LFS (or
24 # No Makefile or python file, anywhere, will be LFS
63 not). Each line is keyed by a file pattern, with a predicate value.
25 **Makefile = none()
64 The first file pattern match is used, so put more specific patterns
26 **.py = none()
65 first. The available predicates are ``all()``, ``none()``, and
66 ``size()``. See "hg help filesets.size" for the latter.
67
68 Example versioned ``.hglfs`` file::
27
69
28 **.zip = all()
70 [track]
29 **.exe = size(">1MB")
71 # No Makefile or python file, anywhere, will be LFS
72 **Makefile = none()
73 **.py = none()
30
74
31 # Catchall for everything not matched above
75 **.zip = all()
32 ** = size(">10MB")
76 **.exe = size(">1MB")
77
78 # Catchall for everything not matched above
79 ** = size(">10MB")
33
80
34 Configs::
81 Configs::
35
82
@@ -41,7 +88,7 b' Configs::'
41 # local filesystem, usually for testing
88 # local filesystem, usually for testing
42 # if unset, lfs will prompt setting this when it must use this value.
89 # if unset, lfs will prompt setting this when it must use this value.
43 # (default: unset)
90 # (default: unset)
44 url = https://example.com/lfs
91 url = https://example.com/repo.git/info/lfs
45
92
46 # Which files to track in LFS. Path tests are "**.extname" for file
93 # Which files to track in LFS. Path tests are "**.extname" for file
47 # extensions, and "path:under/some/directory" for path prefix. Both
94 # extensions, and "path:under/some/directory" for path prefix. Both
General Comments 0
You need to be logged in to leave comments. Login now