Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing a wiki on a github repo

Tags:

git

github

wiki

I am trying to edit and make changes on another persons wiki for their repo. I cloned it locally with the following:

git clone https://github.com/***/***.wiki.git

I then edited it and completed the desired changes. Now, how do I go about pushing said changes? Do I need to open a pull request for this and how would I go about it? Any help would be greatly appreciated. I tried to push changes on the same remote origin branch but I get the Permission denied (publickey) error.

like image 799
zweed4u Avatar asked Aug 07 '16 16:08

zweed4u


People also ask

How do I edit a wiki page?

How do I edit a page? To edit the whole page at once, click the "edit this page" tab at the top. To edit just one section, click the "edit" link to the right of the section heading. To edit on Wikipedia, you type in a special markup language called wikitext.

Can you edit directly on GitHub?

You can edit files directly on GitHub in any of your repositories using the file editor.

Can you fork a GitHub wiki?

You can't fork it directly on GitHub, but you can get Git access to it by going into the Git access tab of the wiki and you should be able to fork it on your local machine and edit it as much as you want (and even get updates to it!)

How do I add a wiki file to GitHub?

How do I add files to a wiki page? You need to clone the wiki repo and edit it on your system. Add files to the files directory (or subdirectory below it). For example: files/project-presentation.


2 Answers

There are two problems here. The first is that you actually seemed to have cloned at ssh linked git repository such as

[email protected]:/***/**.wiki.git

And thus why it is saying Permission denied (publickey). If you'd cloned a https git repo then you would type username / password.

As to how to edit a github wiki locally - By default the branch is master. If you choose to work on sub-branches to separate the work, then you'll need to merge to your local master branch and push. There doesn't seem to be a way to have pull requests for wiki pages.


In summary:

  1. If not done, setup your public/private ssh key in github - https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
  2. Checkout your repo locally - git clone [email protected]:/***/**.wiki.git
  3. Optionally branch so as to separate the work(s) - git checkout -b some_branch
  4. Edit your wiki pages with a markdown editor (I used IntelliJ with a Markdown plugin - it can display the markdown on one page and the rendered page next to it, which is nice.)
  5. Add and commit your work: git add page.md git commit -m "Added blah blah instructions"
  6. Optionally merge back to master: git checkout master git merge some_branch
  7. Push it back to the github repo - git push

Remember, you can't seem to be able to do pull requests with github wiki pages (since the only branch available through Github is master).

like image 141
HankCa Avatar answered Oct 22 '22 20:10

HankCa


Not possible!

Though, you could open an issue to ask the mainter(s) to make the wiki publicly editable.

like image 1
hoijui Avatar answered Oct 22 '22 20:10

hoijui