git - GitLab 是否允许 wiki merge 请求?

标签 git merge gitlab wiki

我知道GitLab将 wiki 页面存储在单独的 Git 存储库中。我们如何为我的项目的 wiki 项目创建 merge 请求?可能吗?

我在 GitHub 上发现了一个类似的问题: How can I make a pull request for a wiki page on GitHub? ,但与 GitLab 无关。

最佳答案

2016:Creating a MR (Merge Request)需要项目的名称,而不是其 wiki 的名称。

解决方法将类似于您的 linked answer 中描述的解决方法

  • 有一个专门的 repo “项目”作为 wiki 的分支/克隆
  • 为这个 wiki 项目/分支制作你的 MR
  • 从这个分支推回到原始的 wiki 仓库

2022:接下来是 Epic 7107 , 这是指 this workaround :

Accepting merge requests on wikis

It's possible to work around the limitation of Wiki permissions by creating a mirror of the git wiki backing the wikis.
This way more users can suggest changes to the wiki by submitting merge requests.

It's not as easy as editing the wiki, but at least provides a way for outside contributors to participate.

To do this, you'll need to create project access tokens in the Wiki and use the repository mirror feature to replicate the wiki into a separate project.

  1. In the Wiki project, head for the Settings: Access Tokens page and create a new token with write_repository access

  2. optionally, create a new project for the wiki, for example called wiki-replica.
    You can also use the same project as the wiki if you do not plan to host other source code specific to that project there.
    We'll call this the "wiki replica" in either case

  3. In the wiki replica, head for the Settings: Mirroring repositories section and fill in the details for the wiki HTTPS clone URL:

    • Git repository URL: the HTTPS URL of the Git repository (which you can find in the Clone repository page on the top-right of the wiki)
      Important: Make sure you add a username to the HTTPS URL, otherwise mirroring will fail.
      For example, this wiki URL:

      https://gitlab.torproject.org/tpo/tpa/team.wiki.git
      

      should actually be:

      https://wiki-replica@gitlab.torproject.org/tpo/tpa/team.wiki.git
      
    • Mirror direction: push (only "free" option, pull is non-free)

    • Authentication method: Password (default)

    • Password: the Access token you created in the first step

    • Keep divergent refs: checked (optional, should make sure sync works in some edge cases)

    • Mirror only protected branches: checked (to keep merge requests from being needlessly mirrored to the wiki)

When you click the Mirror repository button, a sync will be triggered.
Refresh the page to see status, you should see the Last successful update column updated.
When you push to the replica, the wiki should be updated.

Naturally, because of limitations of GitLab, you cannot pull changes from the wiki to the replica.
But considering only a limited set of users have access to the wiki in the first place, this shouldn't be a problem as long as everyone pushes to the replica.

关于git - GitLab 是否允许 wiki merge 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38537259/

相关文章:

Git:如何还原还原

git - POSIX 文件 "."作为别名导致 "CFURLGetFSRef was passed this URL which has no scheme"警告

git - 如何在 Gitlab 中成功的管道结束时创建 merge 请求?

docker - 使用 docker 运行程序和缓存时,Gitlab CICD 本地实例存储空间不足

Gitlab:将外部 url 设置为 https,无需证书

git - 使用版本控制编译工作流

git - 为什么我想做 git rebase?

javascript - 是否有内置方法可以将两个对象的属性合并到一个对象中?

git - 如何使我的分支与其对应的远程分支相同?

svn - 您如何计划合并多个分支机构?