Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Copying a Wiki

I wish to copy a wiki from one repository to another.  I have created a git repository on my machine and cloned the wiki.  I have created the new repository and wish to upload the contents to the new wiki.  The new repository has a wiki defined with the default home.md page.

I am trying to set up the remote for git for the new repository but am getting stuck.  I configure the remote URL with //https:/bitbucket.org/<user name>/<repository name>/Wiki and then I get stuck, what is the mapping for the wiki head version?  I have my Git branch as HEAD but I need a mapping for the remote.  

The documentation says that the wiki is a repository but what is the mapping for uploading?

Any pointers appreciated.

2 answers

1 accepted

0 votes
Answer accepted

I have worked it out.  I did a fetch first which created the link between my local repository and the remote.  I then added my files from the old Wiki to my local repository and the upload worked.

When adding a remote I had to make sure that I used the default branch name from when the repository was set up in the mapping.

1 vote

Hi @mikerb ,

I believe that the push will fail because the wiki in the second repo already has a commit with the default page, and its history is not related to the history of the wiki you are trying to push from.

If the new wiki contains only the default page, and no other commits/changes you want to keep, what you can do is force push from your local repo (of the wiki you want to copy) to the new wiki.

Please note that the force push will remove the existing history of the new wiki, and will replace it with the history of your local clone.

So, in your local clone of the wiki you want to copy, you can do the following:

git remote add second-wiki URL-of-new-wiki
git push -f second-wiki

where second-wiki is the name of the second remote, feel free to replace with a different one.

Please feel free to let me know if you face any issues or if you have any questions.

Kind regards,
Theodora

Thanks for the answer, this I tried and it says it was successful but only uploaded 3 items.  Should the remote be the url of the repository or include wiki, eg. https://bitbucket.org/<user>/<repository> or https://bitbucket.org/<user>/<repository>/wiki?

Should my files be in the folder itself or one called wiki?

See my answer, your answer pointed me in the right direction, thank you

Hi @mikerb, thank you for the update, I'm glad you were able to figure it out.

Just to answer your question as well, the (HTTPS) URL of the wiki should be

https://<username>@bitbucket.org/<workspace-id>/<repo>.git/wiki

The URL

https://<username>@bitbucket.org/<workspace-id>/<repo>

is for the repo that contains the wiki.

You can also find the URL if you open the wiki in Bitbucket website, and then select the Clone wiki link (from the top right corner). This will show you the git clone command along with the URL for this specific wiki.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

260 views 2 10
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you