I have a local repository where I work daily and a remote bare repository where I push my result. I would like after every push to copy some local files that are not under version control (like .exe and .dll files) into a separate directory (bin directory for example) on the same server, is it possible?
I tried with hooks but those work server-side, hence I don’t know how to tell where the files to copy are.
I have a local repository where I work daily and a remote bare repository
Share
git’s hooks aren’t necessarily “server-side” – you can have hooks in any repository. However, there isn’t a hook which is run specifically after you’ve done a
git pushfrom a repository. Something that might be close enough is apost-commithook, so that every time you create a commit locally, you could copy the.exeand.dllfiles into a separate directory.However, if you really do just want to copy after pushing, the simplest solution might be to set up a git alias. For instance, if you do:
… you can just do:
… in your repository, and the files will be copied if the push was successful. (I haven’t tested that alias, but I think that’s right.)