How to Document Your GitHub Project with a README and a Wiki

A guide to writing a clear README and setting up a GitHub wiki: the structure readers expect, a copyable template, Markdown tips, and when docs need their own home.

How to Document Your GitHub Project with a README and a Wiki

Good code does not guarantee that anyone will use it. When someone finds your repository on GitHub, they usually spend only a few seconds deciding whether the project fits their needs, and that decision is almost always based on the documentation on the repository’s front page rather than on the code itself. A project without documentation forces people to guess how to install and run it, and most people would rather leave than guess.

GitHub gives you two main places to write documentation: the README file and the wiki. This article explains what each one is for, how to write a README that genuinely helps the reader, and when your documentation should move into a wiki or a folder of its own.

README vs. wiki

The README is the file GitHub automatically displays below the list of files in a repository. Because it is always the first thing people see, it works like the project’s front page and answers the most basic questions: what the project is, what it is for, how to install it, and how to use it.

The wiki is a separate collection of pages that you reach through the Wiki tab of the repository. It suits documentation that is long and branches into many topics, such as complete configuration guides, architecture explanations, or a growing list of questions and answers. A simple rule of thumb is that the README holds what everyone needs in their first minute, while the wiki holds what some people need once they start digging into your project.

Creating a README file

The easiest way is to tick Add a README file when you create a new repository on GitHub. GitHub then creates a README.md file containing the repository name and the description you entered in the creation form.

If the repository already exists without a README, create a file named README.md in the top-level folder of the project, then commit and push it like any other file. GitHub will also display a README placed in the .github or docs folder, but keeping it at the top level is the most common convention and the easiest for readers to find.

READMEs are written in Markdown, a simple text format that uses symbols such as # for headings, - for lists, and three backticks for code blocks. You can edit it directly on GitHub by clicking the pencil icon, or in a code editor on your computer while watching the preview.

The README structure people actually read

There is no official format for a README, but projects known for good documentation tend to follow a similar order, because that order matches the questions that come up in a reader’s mind one after another.

Name and short description. Explain in one or two sentences what the project does and who it is for. Avoid vague descriptions like “a cool web app” and write something specific, such as “a web-based point-of-sale app for small shops that keeps working without an internet connection”.

Screenshot or demo. For anything with a user interface, one image or a short GIF often explains more than several paragraphs. If the app can be tried online, include a link to the demo.

Installation. Write down every step from nothing to a running project, including the versions of the language or tools it needs. Test these steps on another computer or in a fresh folder, because what feels obvious to the author is often exactly where other people get stuck.

Usage. Give real examples that can be copied straight away, such as the commands to run or a snippet that calls the main function, and describe the result the reader should expect.

Contributing. If you accept contributions, briefly explain the process, for example that contributors should fork the repository and send a pull request. For longer rules, create a separate CONTRIBUTING.md file, and GitHub will show a link to it to anyone opening an issue or pull request.

License. State the project’s license, such as MIT or Apache 2.0, and include a LICENSE file in the repository. Without a license, other people legally have no permission to use your code. The choosealicense.com site helps you pick a suitable one.

A README template

Here is a README skeleton you can copy and adapt. Remove any section that does not apply to your project, because a short but complete README is far more useful than a long one full of empty sections.

# Project Name

One or two sentences explaining what this project does and who it is for.

![Screenshot of the app](docs/screenshot.png)

## Installation

Requires Node.js 20 or later.

```bash
git clone https://github.com/username/project-name.git
cd project-name
npm install
```

## Usage

```bash
npm run dev
```

Open http://localhost:3000 in your browser.

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

## License

[MIT](LICENSE)

Tips for a more readable README

Use section headings (##) consistently, because GitHub automatically builds an outline from them that readers can open from the list icon at the top right of the README. That means you do not have to maintain a table of contents by hand, even in a fairly long README.

Put every command in a code block and include the language name, such as bash or json, so GitHub applies syntax highlighting and shows a copy button. When linking to other files in the repository, use relative paths such as docs/configuration.md, because relative links keep working in forks and on other branches.

If your project has a flow or architecture that is hard to describe in words, GitHub supports Mermaid diagrams directly in Markdown. You write the diagram as text inside a code block labelled mermaid, and GitHub renders it as an image, so updating the diagram is as easy as editing text.

Setting up a GitHub wiki

Wikis are free for public repositories, while private repositories need a paid plan to use them. If you do not see the Wiki tab, open the repository’s Settings and tick Wikis under Features.

Once the tab is visible, click it and choose Create the first page. This first page is automatically named Home and becomes the wiki’s front page, so use it for an overview and links to the other pages. You add more pages with the New page button, and each page appears automatically in the wiki sidebar in alphabetical order.

If you want to control the navigation yourself, create special pages named _Sidebar for the sidebar and _Footer for the bottom of every page. Both are shown across the whole wiki.

Every change to the wiki is recorded like a regular commit, so you can see who changed what and restore an older version when needed. The wiki is in fact a Git repository of its own, and its clone address is shown on the right side of the wiki page. That means you can write and edit wiki pages on your computer in your favourite editor and push them like any other change.

When to use a docs folder or GitHub Pages

A wiki is convenient for small and medium projects, but it has one weakness: its content lives apart from the code. Changes to the code and changes to the documentation cannot be reviewed together in one pull request, so the documentation easily falls behind as the code keeps changing.

That is why many larger projects keep their documentation as Markdown files in a docs folder inside the repository. A contributor who changes a feature can then update its documentation in the same pull request, and reviewers can make sure the two still match. If you want the documentation to appear as a website, that folder can be published with GitHub Pages, either directly or through a static site generator such as Docusaurus, VitePress, or Astro Starlight.

Frequently asked questions

Does every repository need a README?

It is not technically required, but it is strongly recommended. A repository without a README only shows a list of files, so visitors have no idea what the project contains or how to use it.

What is a GitHub profile README?

If you create a public repository whose name exactly matches your GitHub username, the README in that repository is shown on your profile page. Developers often use it to introduce themselves, highlight their best projects, and explain how to get in touch.

Which language should I write my README in?

Use the language your intended users understand best. Projects aimed at developers around the world usually use English, while a project for a local community or a university assignment can use the local language. Some projects offer both, for example README.md in English and README.id.md in Indonesian.

Can other people edit my wiki?

By default, only people with write access to the repository can edit its wiki. For a public repository you can let every GitHub user edit the wiki through the Features settings, but only turn that on if you are prepared to keep an eye on the changes.

If you want to contribute to the documentation of someone else’s project, the first step is to fork it. The full walkthrough is in what a fork is on GitHub and how to use it to contribute.

Advertisement
ProgrammingSoftwareGit
Building a product that has to stay reliable? I help founders and product teams scope, build and scale web and mobile products, with testing built in from day one.
Book a call

Keep reading

All articles