GitHub AE limits the size of files allowed in repositories. If you attempt to add or update a file that is larger than 50 MB, you will receive a warning from Git. The changes will still successfully push to your repository, but you can consider removing the commit to minimize performance impact. For more information, see "Removing files from a repository's history."
Note: If you add a file to a repository via a browser, the file can be no larger than 25 MB. For more information, see "Adding a file to a repository."
GitHub AE blocks pushes that exceed 100 MB.
To track files beyond this limit, you must use Git Large File Storage (Git LFS). For more information, see "About Git Large File Storage."
If you need to distribute large files within your repository, you can create releases on your enterprise instead of tracking the files. For more information, see "Distributing large binaries."
Git is not designed to handle large SQL files. To share large databases with other developers, we recommend using Dropbox.
Warning: These procedures will permanently remove files from the repository on your computer and your enterprise. If the file is important, make a local backup copy in a directory outside of the repository.
If the file was added with your most recent commit, and you have not pushed to your enterprise, you can delete the file and amend the commit:
- Open TerminalTerminalGit Bash.
- Change the current working directory to your local repository.
- To remove the file, enter
git rm --cached:
$ git rm --cached giant_file # Stage our giant file for removal, but leave it on disk
- Commit this change using
$ git commit --amend -CHEAD # Amend the previous commit with your change # Simply making a new commit won't work, as you need # to remove the file from the unpushed history as well
- Push your commits to your enterprise:
$ git push # Push our rewritten, smaller commit
If you added a file in an earlier commit, you need to remove it from the repository's history. To remove files from the repository's history, you can use the BFG Repo-Cleaner or the
git filter-branch command. For more information see "Removing sensitive data from a repository."
If you need to distribute large files within your repository, you can create releases on your enterprise. Releases allow you to package software, release notes, and links to binary files, for other people to use. For more information, visit "About releases."