您可以阻止默认推送,但可以拉吗? [英] Can you prevent default-push, but allow pull?

查看:43
本文介绍了您可以阻止默认推送,但可以拉吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法关闭默认推送,但是在使用Mercurial时保留默认推送.我不想因疏忽而从实验存储库中推送而意外污染主存储库.

I want to know if there's a way to turn off the default push, but keep the default pull when using Mercurial. I don't want to accidentally pollute the master repository by inadvertently pushing from an experimental repository.

推荐答案

您的解决方案可能是最快且肯定有效的.如果有任何 official 方式,它将使用preoutgoing钩子:

Your solution probably is the quickest and is certainly effective. If there's any official way it would be using a preoutgoing hook:

[hooks]
preoutgoing = bash -c 'read -p "Really push to $HG_URL? " -n 1 RESP ; [ "$RESP" == "y" ]'

它将询问您是否要推送并提供提示的URL.

which will ask you if you want to push and provide the URL to which it would go as a reminder.

这篇关于您可以阻止默认推送,但可以拉吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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