0

I am trying to print the repo name from which the commits are being pushed on to the central repo in the post-receive script that is used for mailing git pushes . I tried adding the following code to a script from

https://github.com/zma/usefulscripts/blob/master/script/post-receive

IN main -

        dir=`git rev-parse --show-toplevel`
        echo "$dir"
        base=`basename "$dir"`
        echo "$base"

But it prints nothing when I do a push. can anyone please help me? Thanks

Newbie
  • 2,664
  • 7
  • 34
  • 75
  • Do I understand you correctly? You want to get the repository name of your local repository on the server when you push? I don't think that's possible. May I ask why? – Sascha Wolf Apr 16 '15 at 07:07
  • So that I can display it in the email from which repo the push is being done – Newbie Apr 16 '15 at 07:26
  • 1
    Relevant: [How to get pusher's Information in post-receive hooks?](http://stackoverflow.com/questions/11280661/how-to-get-pushers-information-in-post-receive-hooks) – Sascha Wolf Apr 16 '15 at 07:54

0 Answers0