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)
22 if cfg.IsDefaultRemote() {
23 endpoint := getAPIClient().Endpoints.Endpoint("download", cfg.Remote())
24 if len(endpoint.Url) > 0 {
25 access := getAPIClient().Endpoints.AccessFor(endpoint.Url)
26 Print("Endpoint=%s (auth=%s)", endpoint.Url, access)
27 if len(endpoint.SshUserAndHost) > 0 {
28 Print(" SSH=%s:%s", endpoint.SshUserAndHost, endpoint.SshPath)
33 for _, remote := range cfg.Remotes() {
34 remoteEndpoint := getAPIClient().Endpoints.RemoteEndpoint("download", remote)
35 remoteAccess := getAPIClient().Endpoints.AccessFor(remoteEndpoint.Url)
36 Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, remoteAccess)
37 if len(remoteEndpoint.SshUserAndHost) > 0 {
38 Print(" SSH=%s:%s", remoteEndpoint.SshUserAndHost, remoteEndpoint.SshPath)
42 for _, env := range lfs.Environ(cfg, getTransferManifest()) {
46 for _, key := range []string{"filter.lfs.process", "filter.lfs.smudge", "filter.lfs.clean"} {
47 value, _ := cfg.Git.Get(key)
48 Print("git config %s = %q", key, value)
53 RegisterCommand("env", envCommand, nil)