F
F
fastpars2012-11-05 13:05:00
git
fastpars, 2012-11-05 13:05:00

Git hooks (bare). How can I find out the name of the branch where the last commit was made?

subj
Or how to find out the name of the branch to which the push occurred in the hook? I didn't find anything similar
in env .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2012-11-05
@fastpars

Post-update hook example:

#!/bin/bash

branch=`git rev-parse --symbolic --abbrev-ref $1`
echo "Pushed to branch '$branch'"
exec git update-server-info

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question