1

I have a post-receive hook that create a file after a push on master branch

branch_name=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch_name" ]; then
    touch OK_push.txt
fi

Is it possible to do the same thing after a merge (or pull) between one branch on master branch?

larsks
  • 43,623
  • 14
  • 121
  • 180
xergiopd
  • 111
  • 4

1 Answers1

1

If you read through the list of available hooks, you see that there is a post-merge hook...

...but it's not clear from your question that this will do what you want. A post-receive hook runs on a remote git repository after receiving updates from a client, while a post-merge hooks runs in your local repository after a merge operation (including git pull, unless you've set git to rebase rather than merge).

larsks
  • 43,623
  • 14
  • 121
  • 180