Reza
Reza

Reputation: 1124

Gitlab Wiki - How to import wiki when importing a repository

I have a Gitlab CE 11.7 docker running on my server. When I import a project from gitlab.com, its wiki is missing. I use the built-in interface to import the projects:

New Project > Import project [tab] > GitLab.com [button]

then I choose the repository to import from a list of repositories connected to my account.

Is there a way to migrate the wiki of a repository from Gitlab.com to a GitLab CE instance?

Upvotes: 8

Views: 9147

Answers (3)

VonC
VonC

Reputation: 1323115

As noted in djuarezg's answer

Wikis are repos as well. You can clone a projec

And with GitLab 17.1 (June 2024), you now have an easier and quicker cloning with a new wiki repository clone button.

See Documentation and Issue.

clone wiki -- https://gitlab.com/-/project/278964/uploads/dd67bcb7c9c59de282eee00396546d4e/image.png

Upvotes: 1

Nicolas Thery
Nicolas Thery

Reputation: 2448

The valid answer is just what I needed. I still want to share the whole process to get the migration done is a few steps. I have a dedicated git server but you can use http.

git clone  [email protected]:myGroup/myRepo.wiki.git
git remote rename origin oldorigin
git remote add origin [email protected]:myGroup/myRepo.wiki.git
git fetch origin
git push --force

Force is necessary as there will not be common points in the imported history.

Upvotes: 8

djuarezg
djuarezg

Reputation: 2541

Wikis are repos as well. You can clone a project by doing:

git clone https://gitlab.com/{namespace}/{project}.wiki.git

If you click the "Git Access" link at the top in your wiki, you also get this URL.

Since it is a repo you can then push to the desired destination wiki.

Upvotes: 16

Related Questions