{"thread":{"id":"18505","subject":"git hooks to run something","startedAt":"2009-03-24T10:56:05Z","lastAt":"2009-03-25T11:25:08Z","messageCount":3,"participants":["Alf Clement","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109201","messageId":"556d90580903240356q3a72fd0bwa5ebe335914bc469@mail.gmail.com","threadId":"18505","inReplyTo":null,"subject":"git hooks to run something","fromName":"Alf Clement","fromEmail":"alf.clement@gmail.com","sentAt":"2009-03-24T10:56:05Z","receivedAt":"2009-03-24T10:56:05Z","isPatch":false,"sender":{"key":"alf.clement@gmail.com","avatar":null},"body":"Hi all,\n\nwhen I switch between branches, I would like like to delete some\nobject files and prepare some setup files.\nI there a good way to do this automatically when I run \"git checkout\nbranch\", like\nmisusing a hook to run a make in a special directory?\nAll would happen in my local repository.\n\nThanks,\nAlf\n"},{"id":"109203","messageId":"20090324111524.GA6291@coredump.intra.peff.net","threadId":"18505","inReplyTo":"556d90580903240356q3a72fd0bwa5ebe335914bc469@mail.gmail.com","subject":"Re: git hooks to run something","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-24T11:15:25Z","receivedAt":"2009-03-24T11:15:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 24, 2009 at 11:56:05AM +0100, Alf Clement wrote:\n\n> when I switch between branches, I would like like to delete some\n> object files and prepare some setup files.\n> I there a good way to do this automatically when I run \"git checkout\n> branch\", like\n> misusing a hook to run a make in a special directory?\n> All would happen in my local repository.\n\nThere is a post-checkout hook; see \"git help hooks\" for details.\n\nYou could also make an alias; see the documentation for \"alias.*\" in\n\"git help config\".\n\n-Peff\n"},{"id":"109340","messageId":"20090325112507.GA4437@coredump.intra.peff.net","threadId":"18505","inReplyTo":"556d90580903250333l496520ao5fde64fb08faf9ae@mail.gmail.com","subject":"Re: git hooks to run something","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-25T11:25:08Z","receivedAt":"2009-03-25T11:25:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"[re-adding git@vger to cc; please keep questions on-list so that others\ncan also help to answer]\n\nOn Wed, Mar 25, 2009 at 11:33:39AM +0100, Alf Clement wrote:\n\n> is there a way to push a modified hook script with the repository when\n> I push it to a server?\n> And how to get it with pull?\n\nNo; for security reasons, no code (including hooks) from remote\nrepositories is automatically run. The usual method is to include the\nhook in your repository and copy it into place after cloning.\n\n-Peff\n"}]}