Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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 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:/<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,

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.<user>/<repository> or<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




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
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

226 views 2 5
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