How do I clone a GitHub wiki?
Asked Answered
A

6

198

How do I clone my GitHub repository's wiki? I know it's saved as a separate Git repository, but I can't remember the path.

I've tried ...reponame/wiki.git and ...reponame.git/wiki, but neither are correct.

Allow answered 26/2, 2013 at 3:27 Comment(1)
That question was actually several questions, one of which got it closed for being off topic. Also, at the time the accepted answer on that question didn't exist. If anything that answer should be marked as a duplicate of this one.Allow
A
325

Append .wiki.git to the repository name.

That is, if your repository name was foobar:

git clone [email protected]:myusername/foobar.git would be the path to clone your repository

and

git clone [email protected]:myusername/foobar.wiki.git would be the path to clone its wiki.

Note: You must have at least one page to be able to clone the wiki repo. (via @tobiasz-cudnik)

Allow answered 26/2, 2013 at 3:27 Comment(8)
Do other users automatically have permission to push if they can edit?Horsewoman
Yes. You can set them to have read access based on whether they're a collaborator, but push permissions require them to be a collaborator. github.com/blog/774-git-powered-wikis-improvedAllow
Works with https urls too: git clone github.com/fpinscala/fpinscala.wikiTerri
The obvious followup question is: Can you clone the github Wiki into the same directory as your repo? Again followed by: Can I then do a normal git push to that repo?Cowans
Important note - you have to have at least one page to be able to clone the wiki repo.Goldagoldarina
What do we do if the repo owner is not a person but a group of people?Allomorph
@Cowans I would not suggest that as it can lead to corrupted repositories. I usually use submodules to have everything in one place.Haha
@Haha How would you use a git submodule in this context?Cowans
D
14

You can clone the git wiki using following command.

git clone https://github.com/<git-username>/<repo-name>.wiki.git
Diggs answered 27/4, 2021 at 19:37 Comment(1)
The full path worked well in VS Git Changes. Thanks. :)Marmawke
G
5

The syntax for cloning Github wiki repository is:

git clone [RepositoryName].wiki.git

If it's a private repository, then you'll prompted to enter your username/password.

Gas answered 9/6, 2019 at 10:8 Comment(0)
F
1

The Wiki pages are managed as a repository. So click on your repository, then on the left side click on Wiki. Finally on the upper right corner click on Clone Repository. There you will clear instructions on how to clone it correctly.

Flyman answered 8/2, 2019 at 8:55 Comment(0)
I
1

You can totally use GitHub website to clone a repo wiki onto your github space.

  1. click + (plus sign) in upper right corner.
  2. click import repository
  3. enter name of old repo with .wiki between .git and repo name, something like [email protected]:projectx/foobar**.wiki**.git
  4. Enter the name of new repo, say fubar_wiki
Impendent answered 31/10, 2022 at 18:2 Comment(0)
W
1

You can copy the URL to the clipboard, see the below screenshot:

Copy URL of wiki repository

The address bar in your browser shows the URL of the main repository (number 1). The wiki that belongs to the main repository is a separate Git repository. You can see it by clicking the Wiki tab (number 2). Then you have a button to copy the URL of the wiki repository (number 3).

Waly answered 23/2, 2023 at 18:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.