将 Gitlab Wiki 导入到新的 Gitlab 实例

人气:479 发布:2022-10-16 标签: git wiki gitlab

问题描述

尝试从以前的 gitlab 服务器将新的 wiki 部署到 gitlab.

Trying to deploy a new wiki into gitlab from a previous gitlab server.

我知道如何创建捆绑文件:

I know how to create a bundle file:

git bundle create wiki.bundle --all

这给了我一个我的 wiki 的捆绑文件(称为 wiki.bundle),打开时有很多与 wiki 存储库相对应的 markdown 文件.当我尝试将其导入新项目时,存储库有两种存储库类型.例如,假设新 wiki 名为new wiki";这将在文件系统中产生两个文件:new-wiki.git 和 new-wiki.wiki.git

This gives me a bundle file of my wiki (called wiki.bundle) and when opened there is a lot of markdown files that correspond to the wiki repository. When I try to import it into the new project there are two repository types for the repository. For example, let's say the new wiki is called "new wiki"; this would yield two files in the filesystem: new-wiki.git and new-wiki.wiki.git

以前,我的工作是在我的 new-wiki.git 文件中发布一个 git clone 和 git pull 的 markdown 包;然后我检索文件"并手动将它们一次导入到 wiki.这可能非常耗时,而且不太实用.

Previously, my work around has been issuing a git clone and git pull of the markdown bundle into my new-wiki.git file; I then retrieve the "files" and manually import them over to the wiki one at a time. This can be very time consuming and not all that practical.

我确实对 new-wiki.wiki.git 尝试了相同的操作,但似乎没有发生任何事情.

I did try the same operation with the new-wiki.wiki.git but nothing appears to happen.

有没有人遇到过这个问题并找到了类似的解决方案?我知道我可以让它工作,但有没有更方便的方法?

Has anyone run into this problem and found a resolution for something like this? I know I can get it to work, but is there a more convenient way?

推荐答案

我想我会把它记下来以防它对任何人有帮助.

I thought I would just put this down in case it helps anyone.

似乎解决我问题的方法是:

The method that seemed to solve my problem was:

mkdir new-wiki
cd new-wiki
git init
git remote add origin http://gitlab-server-ip/account-name/new-wiki.wiki.git
git pull wiki.bundle
git push -u origin master

我遇到的问题是没有任何事情发生的真正反馈".当我进入 gitlab 仪表板时,它也没有显示任何内容.只有直接进入项目,我才能看到它是新填充的.希望这对某人有某种帮助.

The problem I had was there was no real "feedback" that anything was happening. When I go into the gitlab dashboard it shows nothing either. Only by going directly into the project I can see that it is newly populated. Hope this is of some sort of help to someone.

294