2

I want to have local branch in my cloned repository that will not exist in main repository. To do this I create branch named "new_branch", develop and commit to it. Sometimes I make commites to default branch and after that I make "push -b default" that the branch "new_branch" not appeared in main repository. After the development in "new_branch" finished I make merge to default branch and I want to make push for default branch "push -b default". I get message "abort: push creates new remote branches: new_branch! (use 'hg push --new-branch' to create new remote branches)". Can I have a only local branch in Mercurial?

3 Answers 3

3

You can try:

Sign up to request clarification or add additional context in comments.

Comments

0

Phases can be used for this in modern Mercurial:

# hg phase --secret -r 7::10 

Will mark changes 7 through 10 as secret, as so they won't be pushed, pulled, cloned, etc.

2 Comments

That won't solve his problem which is that he wants to merge that branch into default without having to push the branch itself.
Ahh, I missed that. That would change my response to "Don't do that! The history is valuable"
0

Once you create a branch using hg branch, it is a permanent part of the changeset. It will always require you to push using the --new-branch option. You cannot strip the branch name without modifying history.

If you want give a local name to a branch that does not get propagated when you push, then you should use hg bookmark instead.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.