Cannot push after committing to default

I made the mistake of committing to default on my Bitbucket-hosted Mercurial repository. Now, I can no longer push any changes even if they are on another branch. I get an error:

permission denied to update branch default

I've even tried pushing to a specific branch using `hg push -b BranchName`, but the permission error on `default` is a show-stopper even when I'm not trying to push to that branch. How can I fix this so that I'm able to push changes on two other branches?

1 answer

Hi Devon,

Does hg push -f -b BranchName helps? The -f option tells mercurial to force the push operation.

No, that doesn't seem to help. I still get the same error and the changes are not pushed.

Do you also have uncommited changes on your current branch? Check with hg status

If so, you can try the following:

  1. hg shelve --all
  2. hg up correct_branch_name
  3. hg unshelve

The correct_branch_name is the branch to which you actually wanna push the changes. Afterwards you can do hg commit and hg push to make sure your changes are on the new branch.

Did that fix anything?

I saw that, but he says to use advanced options at the bottom of the push window. Not sure how to translate that to the terminal. He does mention specifying which branch you want to push. I'm guessing that would translate to the -b option which I have tried.

I have no uncommitted changes.

What is the output of hg status? Can you add this to this discussion?

Sure thing, and thanks for your help. I get no output from hg status.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

87 views 3 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you