0

I am using git to deploy a website. The webserver contains a bare repository (the hub) and a cloned repo with a checked-out working tree (which is the actual live site). I am working locally and pushing to the hub, and a post-receive hook at the hub pulls the changes into the live repo.

The site contains a huge archive with tons of PDF files (several gigs). Currently these are not managed with git, but are instead synced using other tools which unfortunately do not work properly. I would like to manage everything with git, but due to space constraints I want the files to exist only in the working trees, and not in the git repository (which would double the required size locally and triple it at the webserver as objects in both the hub repo and the live site repo). In other words, I want to sync these files directly from my local computer to the live working tree. I do not need versioning of these files.

Is this possible? I have tried to look into git-fat, but when doing git fat push, it only pushes SHA-named objects into a single directory. I would like to sync the entire PDF archive folder structure, just without keeping the PDF files themselves in the actual git repo (.git/objects).

I am using Windows locally. My webserver is running Linux. I do not think I have permissions to install anything on the server.

cmeeren
  • 3,890
  • 2
  • 20
  • 50

2 Answers2

0

git-media is a tool that seems to help in this situation. It will transfer the media-files using a specified transfer method (scp seems the most appropriate in this case).

When staging files, the files will be copied to a temporary buffer, untill you sync them (git media sync). It will sync them to a specified directory, which could be your the working tree on the server.

Ikke
  • 99,403
  • 23
  • 97
  • 120
  • Same problem as with git-fat. The pdf files are only pushed into a single directory I specify, with SHA-based filenames (no extensions). – cmeeren Dec 09 '14 at 09:19
0

git-media has already been mentioned, and the other canonical answer is git-annex (http://git-annex.branchable.com/). In particular, the subpage "what git-annex is not" (http://git-annex.branchable.com/not/) is worth perusing.

pndc
  • 3,710
  • 2
  • 23
  • 34
  • Thank you, unfortunately I am using Windows which imposes some limitations on git annex (forced direct mode). I am also unsure if it is possible to use it for web deployment without installing it on the webserver (over which I have no control). – cmeeren Dec 09 '14 at 11:17
  • After doing some testing with git-annex I can't get it to mirror a directory tree. Files are copied and stored seemingly as they would be in `.git/objects`. – cmeeren Dec 09 '14 at 12:52