I had a side project to help update a department’s website. The design agency they contracted with delivered the site in PHP and the method of updating the site was uploading new content via FTP.
The first thing I did was fetch the content off the server and commit to a local git repo to preserve its current state. But I couldn’t push the content up to Github because of large PDF files over 50 MB and up to 250 MB in size. Although the 90s and Web 1.5 are back, there are 21st century tools to help: Git LFS.
About Git LFS
Git LFS is a supplemental Git utility that breaks up large files behind the scenes so that they can be uploaded to Github within file size limits (50 MB). It needs to be installed separately, after git.
Following the instructions at https://packagecloud.io/github/git-lfs/install (Linux version shown here)
-
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
-
sudo apt-get install git-lfs
- Head over to the repo with large files and declare the large files pattern from the instructions here: https://github.com/git-lfs/git-lfs#example-usage
- I ran into a problem at the step where I push the repo back up to Github after marking large files and setting up git-lfs: “x509 signed by unknown authority”
-
- To resolve this, disable ssl verification for the specific site (awful workaround):
$ git config http.https://git.sample.com.sslVerify false
- To resolve this, disable ssl verification for the specific site (awful workaround):
-
- Push the code to the repository, it should work now.