I performed some load testing by using JMeter and then tried to checkin my project into git
git add .
git commit -m "message"
Counting objects: 13, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 50.13 MiB | 13.42 MiB/s, done.
Total 13 (delta 8), reused 0 (delta 0)
remote: error: GH001: Large files detected.
remote: error: File java_pid32554.hprof is 412.89 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB
! [remote rejected] feature/branch -> feature/branch (pre-receive hook declined)
error: failed to push some refs to 'https://github.dev.myc.com/p/p.git'
git rm java_pid32554.hprof
added */*.hprof to .gitignore
MacBook-Pro:p (feature/branch>)$ sudo find / -name java_pid32554.hprof
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
This first approach assumes that you don't care about "tracking" the large file; and consequently don't care to keep a copy of it on GitHub. In that case, you'll need to "go back in time" to an earlier commit; to a commit before you added the large, offending file.
You can do the following to do that:
git tag too_big # a "savepoint" just in case you care for it later git log # find an earlier COMMIT_ID git reset --hard COMMIT_ID # replace COMMIT_ID with the one found # See how things are at this point git status
If it's not clean after "git status", maybe you'd be interested in:
# Optionally, this will wipe things out git clean -df
And then continuing your work from that point.
git push master # assuming your branch is master
The tag will give you a point of reference if you ever need to restore that giant file. It will also cause problems when you try to push to GitHub, and thus, push only
master as opposed to a general purpose (ambiguous)
git push (possibly implying
Alternatively, if you must apply "source code control" to the very large file for some reason, you can explore GitHub's LFS (Large File Storage) git extension.
It might be wise to have a git sub-repository (officially known as submodule) for handling large files.