Git LFS - correct way to push new files?

My netlify site is https://awesome-keller-a3b498.netlify.app and has a couple thousand large media files. Love the feature :slight_smile:

Today I added about a hundred more, totaling maybe 100MB. Before I pushed, I ran a git lfs status and saw the correct set of files reported as “Git LFS objects to be pushed to origin/main”. And after a git push, git lfs status returned a clean result. But the push took mere moments and reported less than two MB transferred, so I knew the images didn’t really go up.

The only way I’ve found to actually get new files served by my site is with a time-consuming git lfs push --all origin main that reuploads every single file.

Hi, @kbro. I’ve not heard of this behavior before. Would you please send us the output of the following commands?

netlify lm:info
git config --list
GIT_TRACE=true GIT_CURL_VERBOSE=true git push

Note, if you are on a Windows system, adding the environment variables in the last example will be done differently.

Also, that last command would be most helpful if you are pushing a commit with new Git LFS files included (new meaning files not in the repo at all before this commit).

Thanks! Sorry for the slow reply, but I did have a couple dozen more large files to push up today.

> netlify lm:info
  √ Checking Git version [2.21.0.windows.1]
  √ Checking Git LFS version [2.7.1]
  √ Checking Git LFS filters
  √ Checking Netlify's Git Credentials version [0.1.9]
> git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=<snip>
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
http.sslbackend=openssl
http.sslcainfo=<snip>
core.editor=<snip>
user.email=<snip>
user.name=<snip>
gui.recentrepo=<a different netlify site>
gui.recentrepo=<a php project>
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
include.path=C:/Users/<me>/.netlify/helper/git-config
credential.helper=
credential.helper=netlify
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://github.com/<me>/builduvs.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
lfs.https://938b1331-2875-4850-9d08-e7ac62f03ede.netlify.app/.netlify/large-media.access=basic
lfs.https://938b1331-2875-4850-9d08-e7ac62f03ede.netlify.app/.netlify/large-media.locksverify=false

And finally –

$ GIT_TRACE=true GIT_CURL_VERBOSE=true git push
11:17:05.102604 exec-cmd.c:236          trace: resolved executable dir: <git dir>/bin
11:17:05.103602 git.c:419               trace: built-in: git push
11:17:05.104599 run-command.c:643       trace: run_command: GIT_DIR=.git git remote-https origin https://github.com/<me>/builduvs.git
11:17:05.127538 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:05.129532 git.c:676               trace: exec: git-remote-https origin https://github.com/<me>/builduvs.git
11:17:05.129532 run-command.c:643       trace: run_command: git-remote-https origin https://github.com/<me>/builduvs.git
11:17:05.146487 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
* Expire in 0 ms for 6 (transfer 0x351ab70)
* Couldn't find host github.com in the _netrc file; using defaults
* Expire in 1 ms for 1 (transfer 0x351ab70)
* Expire in 1 ms for 1 (transfer 0x351ab70)

< cutting out four thousand and twenty three more lines between 0 and 6 ms>

<empty space to be noticeable while scrolling>
* Expire in 6 ms for 1 (transfer 0x351ab70)
*   Trying 140.82.113.3...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x351ab70)
* Connected to github.com (140.82.113.3) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: <git dir>/ssl/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
*  start date: Mar 25 00:00:00 2021 GMT
*  expire date: Mar 30 23:59:59 2022 GMT
*  subjectAltName: host "github.com" matched cert's "github.com"
*  issuer: C=US; O=DigiCert, Inc.; CN=DigiCert High Assurance TLS Hybrid ECC SHA256 2020 CA1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x351ab70)
> GET /<me>/builduvs.git/info/refs?service=git-receive-pack HTTP/2
Host: github.com
User-Agent: git/2.21.0.windows.1
Accept: */*
Accept-Encoding: deflate, gzip
Pragma: no-cache

* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 401
< server: GitHub Babel 2.0
< content-type: text/plain
< content-security-policy: default-src 'none'; sandbox
< content-length: 26
< www-authenticate: Basic realm="GitHub"
< x-github-request-id: D6B6:35A0:30603C:8B8910:61742771
< x-frame-options: DENY
<
* Connection #0 to host github.com left intact
11:17:05.334983 run-command.c:643       trace: run_command: 'git credential-netlify get'
11:17:05.372882 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:05.374877 git.c:676               trace: exec: git-credential-netlify get
11:17:05.374877 run-command.c:643       trace: run_command: git-credential-netlify get
time="2021-10-23T11:17:05-04:00" level=debug msg="Initializing Netlify credential helper" args="[git-credential-netlify get]"
time="2021-10-23T11:17:05-04:00" level=debug msg="Git input received" host=github.com protocol=https
11:17:05.433719 run-command.c:643       trace: run_command: 'git credential-manager get'
11:17:05.460647 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:05.462641 git.c:676               trace: exec: git-credential-manager get
11:17:05.462641 run-command.c:643       trace: run_command: git-credential-manager get
* Expire in 0 ms for 6 (transfer 0x351ab70)
* Found bundle for host github.com: 0x3520c60 [can multiplex]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (140.82.113.3) port 443 (#0)
* Server auth using Basic with user 'PersonalAccessToken'
* Using Stream ID: 3 (easy handle 0x351ab70)
> GET /<me>/builduvs.git/info/refs?service=git-receive-pack HTTP/2
Host: github.com
Authorization: Basic <base64>
User-Agent: git/2.21.0.windows.1
Accept: */*
Accept-Encoding: deflate, gzip
Pragma: no-cache

< HTTP/2 200
< server: GitHub Babel 2.0
< content-type: application/x-git-receive-pack-advertisement
< content-security-policy: default-src 'none'; sandbox
< expires: Fri, 01 Jan 1980 00:00:00 GMT
< pragma: no-cache
< cache-control: no-cache, max-age=0, must-revalidate
< vary: Accept-Encoding
< x-github-request-id: D6B6:35A0:306047:8B8931:61742771
< x-frame-options: DENY
<
* Connection #0 to host github.com left intact
11:17:06.245073 run-command.c:643       trace: run_command: 'git credential-netlify store'
11:17:06.272001 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:06.273996 git.c:676               trace: exec: git-credential-netlify store
11:17:06.273996 run-command.c:643       trace: run_command: git-credential-netlify store
time="2021-10-23T11:17:06-04:00" level=debug msg="Initializing Netlify credential helper" args="[git-credential-netlify store]"
11:17:06.322372 run-command.c:643       trace: run_command: 'git credential-manager store'
11:17:06.351294 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:06.352291 git.c:676               trace: exec: git-credential-manager store
11:17:06.352291 run-command.c:643       trace: run_command: git-credential-manager store
11:17:06.534803 run-command.c:643       trace: run_command: .git/hooks/pre-push origin https://github.com/<me>/builduvs.git
11:17:06.712836 run-command.c:643       trace: run_command: git send-pack --stateless-rpc --helper-status --thin --progress https://github.com/<me>/builduvs.git/ --stdin
11:17:06.720814 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:06.721811 git.c:419               trace: built-in: git send-pack --stateless-rpc --helper-status --thin --progress https://github.com/<me>/builduvs.git/ --stdin
11:17:06.723806 run-command.c:643       trace: run_command: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
11:17:06.732783 exec-cmd.c:236          trace: resolved executable dir: <git dir>/libexec/git-core
11:17:06.734777 git.c:419               trace: built-in: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
Enumerating objects: 73, done.
Counting objects: 100% (73/73), done.
Delta compression using up to 4 threads
Compressing objects: 100% (60/60), done.
Writing objects: 100% (60/60), 10.03 KiB | 855.00 KiB/s, done.
Total 60 (delta 23), reused 0 (delta 0)
* Expire in 0 ms for 6 (transfer 0x351ab70)
* Found bundle for host github.com: 0x3520c60 [can multiplex]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (140.82.113.3) port 443 (#0)
* Server auth using Basic with user 'PersonalAccessToken'
* Using Stream ID: 5 (easy handle 0x351ab70)
> POST /<me>/builduvs.git/git-receive-pack HTTP/2
Host: github.com
Authorization: Basic <base64>
User-Agent: git/2.21.0.windows.1
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-receive-pack-request
Accept: application/x-git-receive-pack-result
Content-Length: 10430

* We are completely uploaded and fine
< HTTP/2 200
< server: GitHub Babel 2.0
< content-type: application/x-git-receive-pack-result
< content-security-policy: default-src 'none'; sandbox
< expires: Fri, 01 Jan 1980 00:00:00 GMT
< pragma: no-cache
< cache-control: no-cache, max-age=0, must-revalidate
< vary: Accept-Encoding
< x-github-request-id: D6B6:35A0:30604F:8B8945:61742772
< x-frame-options: DENY
<
remote: Resolving deltas: 100% (23/23), completed with 8 local objects.
* Connection #0 to host github.com left intact
To https://github.com/<me>/builduvs.git
   1c93225..29d33e1  main -> main

Hi, @kbro. I sent the wrong command for the Git test. The actual output required is for this command:

GIT_TRACE=true GIT_CURL_VERBOSE=true git lfs push --all origin

Would you please send the output of that?