Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can only a specific branch be implicitly pulled in Mercurial

Running hg pull implicitly retrieves everything on the default remote repo, while hg pull -b Branch-0 explicitly pulls changes only from branch Branch-0 from default.

Is there a way to configure/script mercurial to implicitly pull only say Branch-0 from remote if a branch is not specified?

It would be great if the default branch could be specific to a remote path, but I don't find that mandatory.

i.e.

$ hg pull remote
# only commits from Branch-0 were pulled
like image 735
clausavram Avatar asked Jan 27 '26 10:01

clausavram


1 Answers

You can work with alias in your .hgrc which allows to define new commands. You can use it also to re-define a built-in command like pull - yet that is explicitly warned against in the help files, so use the last line with great care or not at all:

[alias]
pullmybranch = pull -b MYBRANCH
pull = pull -b MYBRANCH
like image 156
planetmaker Avatar answered Jan 30 '26 12:01

planetmaker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!