LFS is enabled but Control Freak still rejects

Issue #171 resolved
Former user created an issue

Dear support,

we have Control Freak activated for all of our projects to reject files larger then 52MB and display "Encourage Git LFS in push rejection message". This works fine and we have now activated LFS for this repo however we are unable to push files that are over 52MB despite using git lfs. Does Control Freak not able to see the LFS activation and still let the large files?

best regards Tezcan

Comments (7)

  1. Julius Davies [bit-booster.com] repo owner

    Hi Tezcan,

    I’ve asked our engineer to respond to you over email.

  2. Julius Davies [bit-booster.com] repo owner

    Looks like we need to improve Control Freak's push rejection message to better communicate the subtle importance of making sure the older commit (from before "git lfs track" was typed) needs to also be removed from the local history before pushing.

    Julius (our engineer) typically types “git commit --amend” after “git lfs track” to remove the large file from his current branch before pushing:

    git lfs track big-file.zip
    git add .gitAttributes big-file.zip
    
    # *** Important ! Remove the big file from your git history before pushing!
    git commit --amend
    
    git push
    

    The reason the “git commit --amend” works is because "big-file.zip" file is replaced by a small 130 byte LFS pointer file after typing “git lfs track”, and the “git commit --amend” makes it so the LFS pointer file is the ONLY version of the file in the git history. The previous version that pointed to the raw original file is removed thanks to “git commit --amend”.

  3. Julius Davies [bit-booster.com] repo owner

    Was that the problem?

    We’ll make sure to update the instructions in the push response within the next 1-2 weeks.

  4. Julius Davies [bit-booster.com] repo owner

    Control-Freak now outputs much better guidance (for properly using git lfs) with the large file blocking:

    hookOut.println("This repository supports storing large files with 'git lfs'. Use");
    hookOut.println("the following sequence of commands:\n");
    hookOut.println("  git lfs track <path-to-large-file>");
    hookOut.println("  git add .gitattributes <path-to-large-file>");
    hookOut.println("  git commit --amend\n");
    hookOut.println("Note: you must remove the large file completely from your local git");
    hookOut.println("history. Invoking \"git commit --amend\" removes it from the most");
    hookOut.println("recent commit, but if it's farther back, you will need to use");
    hookOut.println("something like \"git rebase --interactive\" instead.");
    
  5. Log in to comment