如何知道“遥控器"?在git pre-push钩子文件中 [英] How to know the "remote" in git pre-push hook file

查看:112
本文介绍了如何知道“遥控器"?在git pre-push钩子文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在预推"文件中,我可以使用 read local_ref local_sha remote_ref remote_sha",但是我想根据特定的远程存储区做一些限制(是的,我的项目中有多个远程地址),那么我该怎么做呢? 预先感谢!

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!

推荐答案

远程名称和url作为参数提供给预推送.

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

remote="$1 url="$2"

remote="$1 url="$2"

将提供您所需的信息

这篇关于如何知道“遥控器"?在git pre-push钩子文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆