0

I am trying to commit/push a 1.2gb tar file to git lfs server using Git on Windows 10

I have tracked the tar extension with:

C:\FilepathTo\Folder> git lfs track '*.tar'

Running git lfs track returns

Listing tracked patterns
    Folder\'*.tar' (Folder\.gitattributes)

I add the .gitattributes file

C:\FilepathTo\Folder> git add .gitattributes

I add the large file

C:\FilepathTo\Folder> git add file.tar  

Then confirm the file is being tracked with

C:\FilepathTo\Folder> git lfs status

    On branch MyAwesomeBranch
    Git LFS objects to be pushed to origin/MyAwesomeBranch:


    Git LFS objects to be committed:

            .gitattributes  (Git: 136g1ea)
            file.tar (Git: 567d1ed)

    Git LFS objects not staged for commit:

I commit the file

C:\FilepathTo\Folder> git commit -m "foo"
    [MyAwesomeBranch ecf9735] foo
     2 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 Folder/.gitattributes
     create mode 100644 Folder/file.tar

And check that the file is being tracked

C:\FilepathTo\Folder> git lfs track ls-files

Which returns nothing.

I check lfs status again and it isn't listed as an object to be pushed.

C:\FilepathTo\Folder> git lfs status
On branch MyAwesomeBranch
Git LFS objects to be pushed to origin/MyAwesomeBranch:


Git LFS objects to be committed:


Git LFS objects not staged for commit:

As expected, pushing fails with

remote: error: File Folder/file.tar is 1229.43 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB

What am i doing wrong? Why is the staged file not being committed to git lfs?

Raptop
  • 169
  • 2
  • 13

1 Answers1

3

The issue was resolved. This command was the issue:

C:\FilepathTo\Folder> git lfs track '*.tar'

I should have used double quotes as below:

C:\FilepathTo\Folder> git lfs track "*.tar"

Which resolved my issue.

Raptop
  • 169
  • 2
  • 13
  • Alas.... This didn't work for me... https://stackoverflow.com/questions/69130913/why-cant-i-get-git-lfs-to-track-a-file – user1245262 Sep 10 '21 at 13:26