{"thread":{"id":"21296","subject":"Update working copy on push without touching several files","startedAt":"2009-10-20T14:43:06Z","lastAt":"2009-10-20T16:45:59Z","messageCount":2,"participants":["Alex Amiryan","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125480","messageId":"4ADDCC7A.8080607@amiryan.org","threadId":"21296","inReplyTo":null,"subject":"Update working copy on push without touching several files","fromName":"Alex Amiryan","fromEmail":"alex@amiryan.org","sentAt":"2009-10-20T14:43:06Z","receivedAt":"2009-10-20T14:43:06Z","isPatch":false,"sender":{"key":"alex@amiryan.org","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHello. I am a web site developer. My team is developing web sites\nlocally using git. Online versions of websites are maintained with git\ntoo. I need to have working copy of my remote git repository (online\nversion of the site) updated by git push (which I do locally). The\nproblem is that I have some files there (like database config) that have\nto be different from local ones and they must not be updated on git\npush. I have made \"git update-index --assume-unchanged\nincs/config.db.php\" but they are not being updated only when I do \"git\npull\" remotely. I have used some post-update hooks which I found on the\nnet, but they all do \"git reset --hard HEAD\" which restores my config\nfiles. Can you please help me to write post-update hook which updates\nremote working copy but doesn't touch my assume-unchanged marked files.\n\n- --\nAlex Amiryan\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n\niEYEARECAAYFAkrdzHMACgkQ1KOfm1RDUTH3eQCgsEy+349Q/BnqLyl+6uQcZ871\nlZgAn38ZlB4r5Utdt9PbxH/oCCIU2cjM\n=2FQ/\n-----END PGP SIGNATURE-----\n"},{"id":"125492","messageId":"200910201846.00650.trast@student.ethz.ch","threadId":"21296","inReplyTo":"4ADDCC7A.8080607@amiryan.org","subject":"Re: Update working copy on push without touching several files","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-10-20T16:45:59Z","receivedAt":"2009-10-20T16:45:59Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Alex Amiryan wrote:\n> Online versions of websites are maintained with git\n> too. I need to have working copy of my remote git repository (online\n> version of the site) updated by git push (which I do locally). The\n> problem is that I have some files there (like database config) that have\n> to be different from local ones and they must not be updated on git\n> push.\n\nMy best results so far were with special config branches that are\nauto-merged in post-receive.  As a simple example, post-receive might\nsimply be\n\n  #!/bin/sh\n\n  git checkout -f master^0\n  git merge config\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}