So I'm trying to publish my personal website using Github Pages. It originally had a couple of video files, but Mr.Terminal told me git doesn't allow files of that size and I conceded. I removed the files, "git add"-ed the folder, and committed the changes. When I type in "git push origin master", however, it still gives me the same error. Am I approaching this wrong?
-
It looks like you didn't remove the large video files from the commit. ('Ticks and Leeches.mp4', 'Awake And Alive.mp4'). Even using `git rm
` to remove the large files won't help you, because these would still be pushed as history. Follow the directions here to purge: https://help.github.com/articles/remove-sensitive-data/ – rmharrison Nov 16 '16 at 01:00 -
Possible duplicate of [Completely remove a file from whole git repository](http://stackoverflow.com/questions/16877530/completely-remove-a-file-from-whole-git-repository) – 1615903 Nov 16 '16 at 05:08
-
I'll try that thanks! – Sanchit Batra Nov 17 '16 at 20:53
2 Answers
Git isn't intended to store large binary files--it's source control. Github is a Git repo (as well as a number of productivity tools) and it's core functionality is tied to supporting Git repo functionality.
The screenshot in your post clearly shows you're trying to add 2 files that exceed the hard 100MB limit Github imposes.
You also have one file over the 'recommended' limit of 50MB.
Here's the answer:
- Remove the 3 large files from being tracked in your local repo
- Assuming you just added them in the latest commit before your attempted push you need to scrub them from your repo like this: https://help.github.com/articles/removing-files-from-a-repository-s-history/
- If you've done a number of commits and this isn't from your last commit, do as one one of the commenter's suggest or this: Completely remove a file from whole git repository
- Try the push again
-
-
-
I ended up redoing the whole thing from scratch..all in good shape now – Sanchit Batra Nov 26 '16 at 11:29
In case you don't have an important history of changes, it will be simpler to create a new local repository with your files.
The problem is with a history of git repository - if you once added a binary file to the git repository, it will be saved in the history forever (and will take a space too). You can delete the file by command git rm my-binary-file and it will be delete the file from "current" version. But it will be appear in the history anyway.
In other case (when you don't want to loose a history of your changes) - read @Ray's answer
- 3,084
- 4
- 21
- 22
