gregsdennis
gregsdennis

Reputation: 8428

fetch branches in a github wiki

Since GitHub wikis are git repositories unto themselves, it should follow that one could create branches. Even GH suggests in there documentation that this is possible.

I've done this with my wiki and pushed it up to GH. But when I pull the repo, it only pulls the master branch, and I can't see any others.

Is there a way that I can access the other branches?

Edit 1

Upvotes: 0

Views: 371

Answers (1)

CodeWizard
CodeWizard

Reputation: 142352

The wiki of your repository is stored as a different repository.
GitHub displays it under your project.

How to clone a Wiki GitHub repo?

# Clones the wiki locally
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.wiki.git

# or using ssh
git clone [email protected]:YOUR_USERNAME/YOUR_REPOSITORY.wiki.git

List all branches

You can use git branch -a which will display all your branches both local and remotes and now you will be able to checkout any existing branch.

# list all local and remote branches
git branch -a

# checkout any required branch
git checkout <branch name>

Upvotes: 3

Related Questions