4 "github.com/git-lfs/git-lfs/config"
5 "github.com/git-lfs/git-lfs/git"
6 "github.com/git-lfs/git-lfs/lfs"
7 "github.com/spf13/cobra"
10 func envCommand(cmd *cobra.Command, args []string) {
11 config.ShowConfigWarnings = true
13 gitV, err := git.Version()
15 gitV = "Error getting git version: " + err.Error()
18 Print(config.VersionDesc)
23 if cfg.IsDefaultRemote() {
24 defaultRemote = cfg.Remote()
25 endpoint := getAPIClient().Endpoints.Endpoint("download", defaultRemote)
26 if len(endpoint.Url) > 0 {
27 access := getAPIClient().Endpoints.AccessFor(endpoint.Url)
28 Print("Endpoint=%s (auth=%s)", endpoint.Url, access)
29 if len(endpoint.SshUserAndHost) > 0 {
30 Print(" SSH=%s:%s", endpoint.SshUserAndHost, endpoint.SshPath)
35 for _, remote := range cfg.Remotes() {
36 if remote == defaultRemote {
39 remoteEndpoint := getAPIClient().Endpoints.RemoteEndpoint("download", remote)
40 remoteAccess := getAPIClient().Endpoints.AccessFor(remoteEndpoint.Url)
41 Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, remoteAccess)
42 if len(remoteEndpoint.SshUserAndHost) > 0 {
43 Print(" SSH=%s:%s", remoteEndpoint.SshUserAndHost, remoteEndpoint.SshPath)
47 for _, env := range lfs.Environ(cfg, getTransferManifest()) {
51 for _, key := range []string{"filter.lfs.process", "filter.lfs.smudge", "filter.lfs.clean"} {
52 value, _ := cfg.Git.Get(key)
53 Print("git config %s = %q", key, value)
58 RegisterCommand("env", envCommand, nil)