Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Mercurial, is there a setting to always push new branches?

When using Mercurial, often I'll do hg push and I'll get this error message:

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

Which is fine, I understand why I get the message. But I always want to push any new branches so I was wondering if there was any way to force Mercurial to remember to always push new branches without me having to do:

hg push
... 
(use 'hg push --new-branch' to create new remote branches)
---
hg push --new-branch
like image 465
lomaxx Avatar asked Oct 22 '22 06:10

lomaxx


1 Answers

There was a way of setting default options for commands on mercurial using the [default] section on .hgrc, but it is now deprecated.

The recommended way of doing that is using aliases. On your .hgrc, put:

[alias]
pushb = push --new-branch

After that use hg pushb to push creating new branches.

like image 125
Rudy Matela Avatar answered Nov 01 '22 16:11

Rudy Matela