From my Workstation, I can “push” modification to a git bare repository on my server, which contains a Hook that runs "git checkout -f", so I can deploy my site via Git.
The thing is that users of my website can upload files (like images). And without those files, the website can't work. So my question is : How can I get to my workstation the modifications on the live version ? (like uploaded files by users).
** EDIT : Some details about the procedure I followed to set this configuration : **
On the server, which already contains the site :
$ cd /home/website/www $ git init $ git add * $ git commit -m 'First commit !'
... then create a bare repository...
$ cd /home/website $ mkdir www.git $ cd www.git $ git init --bare
... then set hooks stuf...
$ git config core.bare false $ git config core.worktree /home/website/www $ git config receive.denycurrentbranch ignore $ cat > hooks/post-receive #!/bin/sh GIT_WORK_TREE=/home/site/www git checkout -f
... then commit for the bare repository :
$ git add /home/website/www $ git commit -m "First commit of the bare repository" On my workstation, on a new folder, to get the whole directory : $ mkdir /Users/me/Sites/website/ $ git init $ git remote add live ssh://root@myserver.com/home/website/www.git $ git pull live master
Then it works. If i modify files on my workstation and want to make them live, I just have to “git push live master”.
I would not recommend to commit those images back to the bare repo (if those images are large or numerous, the size of the bare repo could quickly becomes too important for easy cloning)
But you can use you hook to copy back those images in some shared directory that you can then access from your workstation (and that you can rsync, in order to get only the delta).
Basically, I would recommend getting those images back without using git.