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

ぐ巨炮叔叔 提交于 2019-12-23 04:10:38

问题


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!


回答1:


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

remote="$1 url="$2"

will give the information you needed



来源:https://stackoverflow.com/questions/40837679/how-to-know-the-remote-in-git-pre-push-hook-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!