finding the name of git branch from remote server

Viewed 206

i am trying to find the name of git branch on remote server using a shell script. I put the following command in a script under the bin directory.

git symbolic-ref --short HEAD

When I execute the script using ssh from another machine

ssh -i keyfile.pem user@ipaddress 'bash -s' /path/to/the/script

I get an error

fatal: Not a git repository (or any of the parent directories): .git

Not sure where I am doing wrong. Any help would be appreciated.

Thanks.

1 Answers
Related