Allen
Allen

Reputation: 6882

How to know the "remote" in git pre-push hook file

In the "pre-push" file, I can get some params using " read local_ref local_sha remote_ref remote_sha", but I wanna do some restrictions stuff according to the specific remote repo(yes, there's mutiple remote address in my project), so how can I do this? Thanks in advance!

Upvotes: 1

Views: 115

Answers (1)

prahlad venkata
prahlad venkata

Reputation: 371

remote name and url are supplied as parameters to the pre-push.

remote="$1 url="$2"

will give the information you needed

Upvotes: 2

Related Questions