Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to push from a bitbucket repository to a bitbucket repository?

Jeroen Pluimers July 16, 2013

I want to push from a bitbucket repository to another one.

The steps I did were these:

1. imported https://bitbucket.org/jeroenp/codingindelphi from https://bitbucket.org/NickHodges/codingindelphi (as I could not find the clone option)

2. Cloned https://bitbucket.org/jeroenp/codingindelphi to a local reposotiry using TortoiseHG.

3. Added some files, and locally committed using TortoiseHG.

4. Pushed the commit changes to https://bitbucket.org/jeroenp/codingindelphi using TortoiseHG.

Now I want to push the changes from https://bitbucket.org/jeroenp/codingindelphi back to https://bitbucket.org/NickHodges/codingindelphi but I can't find that option in the bitbucket UI anywhere.

How can I do that?

(I probably did something wrong, so if the above steps are not the right ones, please explain what I should have done to make the final push).

2 answers

1 accepted

0 votes
Answer accepted
Jeroen Pluimers July 16, 2013

I'm going to write this up as an answer as the whole process of solving it might benfit others too.

To cut things short: it is not the solution, but the journey that usually the best teaching aid.

The answer will be edited over time to show the progression, and the points and reasons of failure.

After reading the documentation in the answer by Mary Anthony (thanks Mary!), I was hoping it was relatively straightforward to fix this, so I tried these steps, and they failed:

  1. Delete https://bitbucket.org/jeroenp/codingindelphi
  2. Forkhttps://bitbucket.org/NickHodges/codingindelphi into https://bitbucket.org/jeroenp/codingindelphi
  3. Skip cloning, but keep the existing local repository
  4. In that local repository, start the TortoiseHG Workbench
  5. From the Sync toolbar, perform these: "pull incoming changes", "check for outgoing changes" (basically all), then "push outgoing changes"
  6. At https://bitbucket.org/jeroenp/codingindelphi, perform a compare to https://bitbucket.org/NickHodges/codingindelphi
    Which resulted in an error : 65ce5e8e2efb & 000000000000 are unrelated.
    which I think patches might be able to solve:
    http://stackoverflow.com/questions/7313178/mercurial-error-repository-is-unrelated
    The reason of the failure is that somehow the changesets are not linked (probably because both repositories have different identities: I'll need to sort that out further)

The second was is using Patch Queues (after reading the external documentation referenced from https://confluence.atlassian.com/display/BITBUCKET/Use+patch+queues). This appeared to difficult to do.

The third try is to locally work with patches. That also failed with a similar message: 0a23cca9cf3c & 000000000000 are unrelated.

--jeroen

Jeroen Pluimers July 22, 2013

I created a new question from the error message in the final step: https://answers.atlassian.com/questions/191469/comparing-a-forked-bitbucket-repository-to-the-original-xxxxxxxxxxxx-000000000000-are-unrelated-why

That resulted in a great response by Atlassian with two support tickets.

In the end, the problem was that the source repository was empty, therefore had a nullid as first change-set. That resulted in the fork never to be able to be pushed/pulled back to the original.

Solution:

  1. Make a backup of the badly forked repository
  2. Delete the badly forked repository at bitbucket
  3. Start with a non-empty source repository
  4. Fork the source repository
  5. In the fork repository, commit changes
  6. Create a pull request for those changes

The two support tickets have goals to:

  • prevent forking empty source repositories
  • provide an initial commit for new repositories to they cannot be empty

Thanks Marcus Bertrand for those!
https://bitbucket.org/mbertrand80

1 vote
m
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

Jeroen,

It sounds like you should have just

  1. Forked this repo: https://bitbucket.org/NickHodges/codingindelphi
  2. Cloned your fork to a local repository using TortoiseHg
  3. Added/changed some files and commit to the fork.
  4. Push to the remote fork.
  5. Make a pull request back to Nick's original repo.

These steps are pretty much documented on this page.

Your commits don't look too heavy, you might be able to simply do the fork and replicate the changes manually.

Mary

Jeroen Pluimers July 16, 2013

When performing the compare step (right before the pull request), I get a message "0a23cca9cf3c & 000000000000 are unrelated." so I asked a new question about that: https://answers.atlassian.com/questions/191469/comparing-a-forked-bitbucket-repository-to-the-original-xxxxxxxxxxxx-000000000000-are-unrelated

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events