Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git post-push hook? [duplicate]

Tags:

git

Possible Duplicate:
Local executing hook after a git push?

git has a number of hooks that can call scripts near certain events.

Is it possible to setup a git hook in my working repository that executes something locally after I push to a remote branch? If so which hook is it?

like image 739
Andrew Tomazos Avatar asked Jan 27 '12 19:01

Andrew Tomazos


People also ask

Does git clone copy hooks?

The hooks are copied to the clone, and the post-checkout hook is fired immediately! But the template directory cannot be inside the repository you are cloning - it must already exist on the filesystem before you clone.

What is Githooks?

Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git's internal behavior and trigger customizable actions at key points in the development life cycle.

Do git hooks get pushed?

No. Hooks are per-repository and are never pushed.


1 Answers

The list of hooks in man githooks is complete. There is no post-push hook. There are hooks which run in a repository after someone's pushed into it (i.e. for putting in the central repository), but nothing is triggered in the repository that you pushed from.

If there's a common task you need to do after pushing, you could make an alias which pushes then does that.

like image 100
Cascabel Avatar answered Sep 21 '22 14:09

Cascabel