2013-06-30 25 views
5

當使用水銀,我常常會做hg push,我會得到這個錯誤信息:在Mercurial中,是否有一個設置來總是推新的分支?

(use 'hg push --new-branch' to create new remote branches) 

這很好,我明白爲什麼我得到的消息。但我總是要推動任何新的分支機構,所以我想知道是否有任何方式強迫水銀記得總是推新的分支機構沒有我不得不做的事:

hg push 
... 
(use 'hg push --new-branch' to create new remote branches) 
--- 
hg push --new-branch 

回答

3

有設置默認的一種方式使用.hgrc上的[default]部分對mercurial上的命令進行了選擇,但現在是deprecated。我們推薦使用aliases。在您.hgrc,提出:

[alias] 
pushb = push --new-branch 

在使用hg pushb後,推動建立新的分支機構。

0

您可以在.bashrc添加一個別名:

例子:

alias hgp="hg push --new-branch"

然後hgp總會成功推動的代碼。

相關問題