191

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
joseph.hainline
  • 24,829
  • 18
  • 53
  • 70
  • 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. – joseph.hainline Mar 16 '15 at 20:22

6 Answers6

314

Append .wiki.git to the repository name.

That is, if your repository name was foobar:

git clone git@github.com:myusername/foobar.git would be the path to clone your repository

and

git clone git@github.com: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)

joseph.hainline
  • 24,829
  • 18
  • 53
  • 70
  • 2
    Do other users automatically have permission to *push* if they can edit? – krlmlr Nov 07 '13 at 08:38
  • 1
    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. https://github.com/blog/774-git-powered-wikis-improved – joseph.hainline Nov 12 '13 at 20:27
  • 1
    Works with https urls too: git clone https://github.com/fpinscala/fpinscala.wiki – bluehallu Nov 19 '15 at 14:42
  • 5
    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?* – not2qubit May 19 '17 at 07:34
  • 4
    Important note - you have to have at least one page to be able to clone the wiki repo. – Tobias Cudnik May 22 '18 at 23:07
  • What do we do if the repo owner is not a person but a group of people? – posfan12 Jun 22 '20 at 08:07
  • @not2qubit I would not suggest that as it can lead to corrupted repositories. I usually use submodules to have everything in one place. – Martin Oct 03 '22 at 12:01
  • @Martin How would you use a git *submodule* in this context? – not2qubit Oct 06 '22 at 12:23
11

You can clone the git wiki using following command.

git clone https://github.com/<git-username>/<repo-name>.wiki.git
Venus713
  • 1,441
  • 12
  • 24
  • The full path worked well in VS [Git Changes](https://developercommunity.visualstudio.com/t/VS-Community:-Clone-Project-Wiki/1510875#T-N1537827). Thanks. :) – Laurie Stearn Sep 23 '21 at 15:58
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.

Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
Neeraj Bansal
  • 2,580
  • 16
  • 8
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.

Begueradj
  • 547
  • 7
  • 19
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 git@github.com:projectx/foobar**.wiki**.git
  4. Enter the name of new repo, say fubar_wiki
Serge
  • 3,387
  • 3
  • 16
  • 34
0

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).

Martijn Dirkse
  • 543
  • 7
  • 16