git-lfs/docs
Taylor Blau 5346b02747 commands/command_migrate.go: introduce '--fixup' flag on 'import'
A common invocation of the 'git lfs migrate import' command is with
'--include' and/or '--exclude' flag(s), which specify wildmatch
pattern(s) for which paths to migrate and/or not migrate.

This is useful for retroactively importing a set of files into Git LFS's
care, or fixing up a file that should have been tracked by Git LFS but
was accidentally committed as a large object instead.

In the later case, it is often the reality that a user will run 'git lfs
migrate --import' with an '--include' path that they believe will gather
the file (and the file alone). This approach is brittle because it
requires the user to infer not only the applicable pattern but the
meaning of that pattern. It also requires the user to run more than one
migration when fixing multiple types of files.

The .gitattributes file(s) contained within a repository provide an
authoritative source on what file(s) are considered by Git to be tracked
in Git LFS. We can use this information to infer the correct patterns to
``fix up'' a broken repository.

In the simplest case, if a repository's .gitattributes file contains the
following:

    *.txt filter=lfs merge=lfs diff=lfs -text

But a .txt file matched by that pattern is not parse-able as an LFS
pointer, it will appear as unable to checkout.

Running 'git lfs migrate import --fixup --everything' will correctly
traverse history and find the affected .txt file, read it, create an
object file for it, and store it as an LFS pointer in history.

Thus, a user can run one command which will recognize arbitrarily
complex problems where a file should be tracked by Git LFS, but isn't.

Later, this feature could be combined with the new 'git lfs migrate
export' functionality to also clean files _out_ of Git LFS to object
files when they are not supposed to be tracked as Git LFS objects.
2018-07-06 14:42:48 -05:00
..
api refspec docs 2018-01-17 11:54:08 -07:00
man commands/command_migrate.go: introduce '--fixup' flag on 'import' 2018-07-06 14:42:48 -05:00
proposals update other github/git-lfs references 2016-11-15 10:07:11 -07:00
custom-transfers.md Support standalonetransferagent based on API URL prefix match 2017-09-20 15:04:25 +02:00
extensions.md Fix typo 2015-10-06 01:11:55 +09:00
linux-build.md Format CentOS bullet points in linux-build.md 2015-08-24 16:23:14 -07:00
README.md Allow using custom transfer agents directly 2017-07-31 16:28:07 +02:00
spec.md spec: mention that an empty file is its own LFS pointer 2017-07-28 16:42:17 -04:00

Git LFS Documentation

Reference Manual

Each Git LFS subcommand is documented in the official man pages. Any of these can also be viewed from the command line:

$ git lfs help <command>
$ git lfs <command> -h

Videos

Developer Docs

Details of how the Git LFS client works are in the official specification.

Details of how the GIT LFS server works are in the API specification.