Merge branch 'master' into 0.5.0-ssh-spec
This commit is contained in:
commit
a825d49160
@ -33,6 +33,8 @@ display a progress bar while downloading or opt out of a large download.
|
||||
content locally on a CDN, resumable uploads and downloads, or performing
|
||||
requests in parallel for faster transfers.
|
||||
|
||||
See the [ROADMAP](ROADMAP.md) for other planned and desired features.
|
||||
|
||||
## Known Implementations
|
||||
|
||||
- [GitHub.com](https://github.com/early_access/large_file_storage) (support coming soon!)
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-clean(1) -- Git clean filter that converts large files to pointers.
|
||||
=============================================================================
|
||||
git-lfs-clean(1) -- Git clean filter that converts large files to pointers
|
||||
==========================================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,9 +7,8 @@ git-lfs-clean(1) -- Git clean filter that converts large files to pointers.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Clean calculates a SHA-256 signature of the data from STDOUT, and outputs a
|
||||
Git LFS pointer file. It also queues the file to be pushed by
|
||||
git-lfs-push(1).
|
||||
Read the contents of a large file from standard input, and write a Git
|
||||
LFS pointer file for that file to standard output.
|
||||
|
||||
Clean is typically run by Git's clean filter, configured by the repository's
|
||||
Git attributes.
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-env(1) -- Display the Git LFS environment.
|
||||
=========================================================
|
||||
git-lfs-env(1) -- Display the Git LFS environment
|
||||
=================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,7 +7,7 @@ git-lfs-env(1) -- Display the Git LFS environment.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Displays the current Git LFS environment.
|
||||
Display the current Git LFS environment.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-init(1) -- Ensure Git LFS is configured properly.
|
||||
=============================================================
|
||||
git-lfs-init(1) -- Ensure Git LFS is configured properly
|
||||
========================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,10 +7,10 @@ git-lfs-init(1) -- Ensure Git LFS is configured properly.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Init performs the following actions to ensure Git LFS is setup properly:
|
||||
Perform the following actions to ensure that Git LFS is setup properly:
|
||||
|
||||
* Sets up the clean and smudge filters under the name "lfs".
|
||||
* Installs a pre-push hook to run git-lfs-push(1)
|
||||
* Set up the clean and smudge filters under the name "lfs".
|
||||
* Install a pre-push hook to run git-lfs-push(1)
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-logs(1) - Show errors from the git-lfs command.
|
||||
===========================================================
|
||||
git-lfs-logs(1) - Show errors from the git-lfs command
|
||||
======================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -10,12 +10,12 @@ git-lfs-logs(1) - Show errors from the git-lfs command.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The "logs" command displays errors from the git-lfs command. Any time it
|
||||
Display errors from the git-lfs command. Any time it
|
||||
crashes, the details are saved to ".git/lfs/logs".
|
||||
|
||||
## OPTIONS
|
||||
|
||||
Without any options, `git lfs logs` will simply show the list of error logs.
|
||||
Without any options, `git lfs logs` simply shows the list of error logs.
|
||||
|
||||
* <file>:
|
||||
Shows the specified error log. Use "last" to show the most recent error.
|
||||
|
@ -1,14 +1,14 @@
|
||||
git-lfs-ls-files(1) -- Show information about git lfs files in the index and working tree
|
||||
=============================================================================================
|
||||
=========================================================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git lfs ls-files` [refspec]
|
||||
`git lfs ls-files` [<reference>]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Displays paths of Git LFS files that are found in the refspec. If no refspec is given,
|
||||
the current checked out branch will be scanned.
|
||||
Display paths of Git LFS files that are found in the given reference. If no reference is
|
||||
given, scan the currently checked-out branch.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-push(1) -- Push queued large files to the Git LFS endpoint.
|
||||
=======================================================================
|
||||
git-lfs-push(1) -- Push queued large files to the Git LFS endpoint
|
||||
==================================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,7 +7,7 @@ git-lfs-push(1) -- Push queued large files to the Git LFS endpoint.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Push uploads Git LFS files to the configured endpoint for the current
|
||||
Upload Git LFS files to the configured endpoint for the current
|
||||
Git remote.
|
||||
|
||||
Push is typically run by Git's pre-push hook.
|
||||
@ -15,13 +15,13 @@ Push is typically run by Git's pre-push hook.
|
||||
## OPTIONS
|
||||
|
||||
* `--dry-run`:
|
||||
Prints the files that would be pushed, without actually pushing them.
|
||||
Print the files that would be pushed, without actually pushing them.
|
||||
|
||||
* `--stdin`:
|
||||
Read the repo and refspec on stdin. This is used in conjunction with
|
||||
the pre-push hook and must be in the format used by the pre-push hook:
|
||||
<local ref> <local sha1> <remote ref> <remote sha1>. If --stdin is used
|
||||
the command line arguments will be ignored.
|
||||
<local-ref> <local-sha1> <remote-ref> <remote-sha1>. If --stdin is used
|
||||
the command line arguments are ignored.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,28 +1,28 @@
|
||||
git-lfs-smudge(1) -- Git smudge filter that converts pointer in blobs to the actual content.
|
||||
==============================================================================================
|
||||
git-lfs-smudge(1) -- Git smudge filter that converts pointer in blobs to the actual content
|
||||
===========================================================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git lfs smudge` <path>
|
||||
`git lfs smudge` [<path>]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Smudge takes a Git LFS pointer file in STDIN, parses out the pointer's ID,
|
||||
and then dumps the file's contents to STDOUT. The file will be downloaded from
|
||||
the Git LFS endpoint if needed. The optional <path> argument is only used for
|
||||
a progress bar.
|
||||
Read a Git LFS pointer file from standard input and write the contents
|
||||
of the corresponding large file to standard output. If needed,
|
||||
download the file's contents from the Git LFS endpoint. The <path>
|
||||
argument, if provided, is only used for a progress bar.
|
||||
|
||||
Smudge is typically run by Git's smudge filter, configured by the repository's
|
||||
Git attributes.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
Without any options, `git lfs smudge` will output the raw Git LFS content to
|
||||
STDOUT.
|
||||
Without any options, `git lfs smudge` outputs the raw Git LFS content to
|
||||
standard output.
|
||||
|
||||
* `--info`:
|
||||
Displays the file size, and the local path to the Git LFS file. If the file
|
||||
does not exist, `--` is shown.
|
||||
Display the file size and the local path to the Git LFS file. If the file
|
||||
does not exist, show `--`.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs-status(1) -- Show the status of Git LFS files in the working tree
|
||||
============================================================================
|
||||
=========================================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,12 +7,16 @@ git-lfs-status(1) -- Show the status of Git LFS files in the working tree
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Displays paths of Git LFS objects that have not been pushed to the Git LFS
|
||||
server, have differences between the index file and the current HEAD commit,
|
||||
and paths that have differences between the working tree and the index file.
|
||||
Thi first are what you would push by running git push; the second are what
|
||||
you would commit by running git commit; the third are what you could commit
|
||||
by running git add before running git commit.
|
||||
Display paths of Git LFS objects that
|
||||
|
||||
* have not been pushed to the Git LFS server. These are large files
|
||||
that would be uploaded by `git push`.
|
||||
|
||||
* have differences between the index file and the current HEAD commit.
|
||||
These are large files that would be committed by `git commit`.
|
||||
|
||||
* have differences between the working tree and the index file. These
|
||||
are files that could be staged using `git add`.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
git-lfs-track(1) - View or add Git LFS paths to Git attributes.
|
||||
======================================================================
|
||||
git-lfs-track(1) - View or add Git LFS paths to Git attributes
|
||||
==============================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git lfs track`
|
||||
`git lfs track` [<path>...]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The "track" command starts the given path(s) through Git LFS. The "path" \
|
||||
argument can be a file extension, or a file path. If no paths are provided,
|
||||
this will simply list the tracked paths.
|
||||
Start tracking the given path(s) through Git LFS. The <path> argument
|
||||
can be a pattern or a file path. If no paths are provided, simply list
|
||||
the currently-tracked paths.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* View the paths that Git LFS is tracking currently.
|
||||
* List the paths that Git LFS is currently tracking:
|
||||
|
||||
`git lfs track`
|
||||
|
||||
* Track a new path in Git LFS.
|
||||
* Configure Git LFS to track GIF files:
|
||||
|
||||
`git lfs track *.gif`
|
||||
`git lfs track '*.gif'`
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
git-lfs-untrack(1) - Remove Git LFS paths from Git Attributes.
|
||||
======================================================================
|
||||
git-lfs-untrack(1) - Remove Git LFS paths from Git Attributes
|
||||
=============================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git lfs untrack` [path]*
|
||||
`git lfs untrack` <path>...
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The "untrack" command stops tracking the given path(s) through Git LFS. The
|
||||
"path" argument can be a file extension, or a file path.
|
||||
Stop tracking the given path(s) through Git LFS. The <path> argument
|
||||
can be a glob pattern or a file path.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Prevent a path from using Git LFS clean and smudge filters.
|
||||
* Configure Git LFS to stop tracking GIF files:
|
||||
|
||||
`git lfs untrack '*.gif'`
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
git-lfs(1) -- Work with large files in Git repositories.
|
||||
==========================================================
|
||||
git-lfs(1) -- Work with large files in Git repositories
|
||||
=======================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
@ -7,11 +7,20 @@ git-lfs(1) -- Work with large files in Git repositories.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Git LFS is a set of filters and hooks to work with large files in Git
|
||||
repositories. Instead of storing the large files as Git blobs, Git LFS uses
|
||||
clean and smudge filters to store a pointer in Git blobs instead. The actual
|
||||
file gets pushed to a Git LFS API, and downloaded automatically when a Git
|
||||
branch is checked out.
|
||||
Git LFS is a system for managing and versioning large files in
|
||||
association with a Git repository. Instead of storing the large files
|
||||
within the Git repository as blobs, Git LFS stores special "pointer
|
||||
files" in the repository, while storing the actual file contents on a
|
||||
Git LFS server. The contents of the large file are downloaded
|
||||
automatically when needed, for example when a Git branch containing
|
||||
the large file is checked out.
|
||||
|
||||
Git LFS works by using a "smudge" filter to look up the large file
|
||||
contents based on the pointer file, and a "clean" filter to create a
|
||||
new version of the pointer file when the large file's contents change.
|
||||
It also uses a `pre-push` hook to upload the large file contents to
|
||||
the Git LFS server whenever a commit containing a new large file
|
||||
version is about to be pushed to the corresponding Git server.
|
||||
|
||||
## COMMANDS
|
||||
|
||||
@ -20,7 +29,7 @@ commands and low level ("plumbing") commands.
|
||||
|
||||
### High-level commands (porcelain)
|
||||
|
||||
* git-lfs-config(1):
|
||||
* git-lfs-env(1):
|
||||
Display the Git LFS environment.
|
||||
* git-lfs-init(1):
|
||||
Ensure Git LFS is configured properly.
|
||||
|
18
docs/spec.md
18
docs/spec.md
@ -55,6 +55,14 @@ of rules that Git LFS uses to determine a repository's Git LFS server:
|
||||
2. The `remote.{name}.lfsurl` string.
|
||||
3. Append `/info/lfs` to the remote URL. Only works with HTTPS URLs.
|
||||
|
||||
Git LFS runs two `git config` commands to build up the list of values that it
|
||||
uses:
|
||||
|
||||
1. `git config -l -f .gitconfig` - This file is checked into the repository and
|
||||
can set defaults for every user that clones the repository.
|
||||
2. `git config -l` - A user's local git configuration can override any settings
|
||||
from `.gitconfig`.
|
||||
|
||||
Here's a sample Git config file with the optional remote and Git LFS
|
||||
configuration options:
|
||||
|
||||
@ -84,7 +92,9 @@ $ git lfs init
|
||||
These filters ensure that large files aren't written into the repository proper,
|
||||
instead being stored locally at `.git/lfs/objects/{OID-PATH}` (where `{OID-PATH}`
|
||||
is a sharded filepath of the form `OID[0:2]/OID[2:4]/OID`), synchronized with
|
||||
the Git LFS server as necessary.
|
||||
the Git LFS server as necessary. Here is a sample path to a
|
||||
|
||||
.git/lfs/objects/4d/7a/4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393
|
||||
|
||||
The `clean` filter runs as files are added to repositories. Git sends the
|
||||
content of the file being added as STDIN, and expects the content to write
|
||||
@ -92,10 +102,8 @@ to Git as STDOUT.
|
||||
|
||||
* Stream binary content from STDIN to a temp file, while calculating its SHA-256
|
||||
signature.
|
||||
* Check for the file at `.git/lfs/objects/{OID-PATH}`.
|
||||
* If it does not exist:
|
||||
* Queue the OID to be uploaded.
|
||||
* Move the temp file to `.git/lfs/objects/{OID-PATH}`.
|
||||
* Atomically move the temp file to `.git/lfs/objects/{OID-PATH}` if it does not
|
||||
exist, and the sha-256 signature of the contents matches the given OID.
|
||||
* Delete the temp file.
|
||||
* Write the pointer file to STDOUT.
|
||||
|
||||
|
@ -154,7 +154,7 @@ func (c *Configuration) loadGitConfig() {
|
||||
panic(fmt.Errorf("Error listing git config from file: %s", err))
|
||||
}
|
||||
|
||||
output = listOutput + "\n" + fileOutput
|
||||
output = fileOutput + "\n" + listOutput
|
||||
|
||||
lines := strings.Split(output, "\n")
|
||||
for _, line := range lines {
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
@ -90,6 +91,13 @@ func init() {
|
||||
err = cmd.Wait()
|
||||
}
|
||||
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
if exitErr.ProcessState.Success() == false && os.Getenv("GIT_TERMINAL_PROMPT") == "0" {
|
||||
return nil, fmt.Errorf("Change the GIT_TERMINAL_PROMPT env var to be prompted to enter your credentials for %s://%s.",
|
||||
input["protocol"], input["host"])
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return cmd, fmt.Errorf("'git credential %s' error: %s\n", cmd.SubCommand, err.Error())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user