7

Inside iOS frameworks is a binary that has no extension. My binary exceeds github's size limit of 100MB.

  • I've set up LFS as indicated here
  • I've tried to tell LFS to track my binary by name: git lfs track 'MyFramework'
  • I've tried to tell LFS to track my binary by path: git lfs track 'path/to/MyFramework'
  • No deal either way! Github server still responds by telling me that the file is too large.

Any ideas?

shmim
  • 729
  • 9
  • 21

3 Answers3

4

In git-lfs v1.1.1, the tracking such as git lfs track 'path/MyFramework' works well. You can check whether or not git-lfs track the file correctly with 'ls-files'.

$ git lfs ls-files
828a9ca55c * path/MyFramework

If git already tracks the file, git-lfs doesn't track it. I think you have to remove tracking MyFramework file, and then add git lfs track .., and then commit it again.

Outsider
  • 923
  • 1
  • 9
  • 20
  • 1
    "If git already tracks the file, git-lfs doesn't track it." That's the ticket, thanks! – shmim Feb 11 '16 at 18:19
3

Some notes for people who find this:

  • As Outsider said, you have to add the file to GIT LFS before adding it to GIT:git lfs track 'path/to/file
  • If file is already in GIT, you need to remove it first. If you've already committed the file locally to GIT in the past, you have a legitimate issue. You won't be able to commit your local deletion of the file, as the remote repo will first need to have the file before deleting it. I worked around this by reverting my repo to a state before the large file existed, using the command listed here. If you can't do that, you'll have to solve this issue some other way. GIT is infinitely flexible, albeit opaque...
  • Before git lfs-ls-files will confirm that LFS is tracking your file, you must add the file to actual GIT: git add someFile
  • My GIT client (Gitbox) doesn't seem to know how to deal with GIT LFS, so I needed (at least the first time) to add, commit and push (see here) on the command line.
Community
  • 1
  • 1
shmim
  • 729
  • 9
  • 21
  • Can you expand on this statement? `You won't be able to commit your local deletion of the file, as the remote repo will first need to have the file before deleting it.`. I don't understand why a simple revert of the commit that added the file wouldn't work in this case. – johnny Feb 28 '20 at 18:46
0

I've been trying to find the solution to this for a while and every answer was to use git lfs track .. Which is great for single files, but doesn't handle new files being added.

Adding this to the .gitattributes file worked for finding everything that doesn't have an extension in a Repo:

* filter=lfs diff=lfs merge=lfs -text # Include everything
/**/ -filter=lfs -diff=lfs -merge=lfs -text # Exclude directories
*.* -filter=lfs -diff=lfs -merge=lfs -text # Exclude anything with an extension