I had a small set of changes in a local git repository; I wanted to send it to an external repository where a number of nodes could fetch it, but introducing only the smallest amount of change. This command did the trick:
rsync -zav --delete --exclude .git --no-owner --no-group --checksum --omit-dir-times . root@somewhere:/path
Why are you using rsync while you're already using git?Couldn't you push [1]?A.[1] http://stackoverflow.com/questions/279169/deploy-php-using-git
For a number of combined reasons :)The main one: there was just a local change that I wanted to test: if it didn't work, I'd just abort it.The change I wanted to check was deployed on a server and then propagated through a hierarchy of distribution servers. In normal conditions it is the git repository that feeds the main DS; this time I fed it from my workstation. If anything went wrong, re-feeding it from git and redistributing the files would reset everything to the previous state.Finally, the git repository and the DS must be on different machines for reasons that I won't discuss here 😉