Can you prevent default-push, but allow pull?

后端 未结 4 1054
悲哀的现实
悲哀的现实 2020-12-18 07:07

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 b

4条回答
  •  不知归路
    2020-12-18 08:06

    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" ]'
    

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

提交回复
热议问题