linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
Intro
Lessons
Footer
linuxlab-TutorialsPricingAboutPrivacy & cookies
Copyright © 2026 LinuxLab. All rights reserved.
linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
  • Introduction
  • Chapters
  • How it works
  • Lessons
  • Knowledge base
  • Interview prep
home/git/kb/Open source/contributing-md

kb/oss ── Open source ── beginner

CONTRIBUTING.md

A file in the repository root (or in `.github/`) that sets the rules for contributors: how to set up the environment, how to format commits, how to submit a PR. The clearer the CONTRIBUTING file, the fewer "how do I run this?" questions land in Issues.

view as markdownaka: contributing-file, contribute-guide

CONTRIBUTING.md is the guide for people who want to help. It is not the README (what the project is), but a separate document about the workflow for working with the code.

A good CONTRIBUTING file saves maintainers hours: instead of explaining things in every Issue, they send a link.

Minimum contents

1. How to run locally

markdown
## Local setup
1. `git clone git@github.com:foo/bar.git`
2. `cd bar`
3. `make install` (or `npm install`)
4. `make test` to verify the setup
Requires: Python 3.11+, Docker.

Without this, a newcomer spends an hour figuring out what to do. Test the instructions on a fresh machine every six months; they tend to go stale.

2. Code style

markdown
## Code style
- Run `make fmt` before committing - uses `ruff format` and
  `prettier`.
- Run `make lint` to catch issues.
- Tests must be in `tests/`, mirror module structure.

One or two commands that automate everything beats a 50-page style guide. See gpg-signing on pre-commit hooks for automation.

3. Commit format

Often a convention such as conventional-commits:

markdown
## Commit messages
We use Conventional Commits:
- `feat: add user login`
- `fix: handle null in pagination`
- `docs: update README`
- `refactor: extract helper`
Reference issue: `fix: timeout (#123)`.

Without a stated format, every PR is a different style. With one, you get a consistent history and auto-generated CHANGELOGs.

4. PR process

markdown
## Pull Request process
1. Fork the repo, create a branch from `main` (see
   [[upstream-vs-origin]]).
2. Make your changes; keep PRs focused on one thing.
3. Run `make test` locally - CI also runs it.
4. Open a PR with description: what changed, why, what was tested.
5. Address review comments; maintainer merges when approved.

A concrete workflow prevents "why squash?" surprises at merge time.

5. How to report a bug or request a feature

This often belongs in Issues documentation, but it can be convenient here as well:

markdown
## Reporting bugs
Use the «Bug report» Issue template. Include:
- what you did,
- what you expected,
- what happened,
- your environment (OS, version, ...).
## Feature requests
Open a Discussion before a PR. We may already have plans.

6. Code of Conduct (optional)

Projects with a large community usually have a separate CODE_OF_CONDUCT.md or a link from CONTRIBUTING. The Contributor Covenant is common.

What NOT to include

  • Do not write "follow the existing style, ask if unsure." That is unreadable. Provide concrete commands and rules instead.
    • Do not duplicate the README. CONTRIBUTING is about the process (how to contribute); the README is about what (what the project is, how to use it).
    • Do not let CONTRIBUTING exceed 200 lines. If it grows beyond that, split into separate documents (docs/dev-setup.md, docs/release-process.md).

Where to put it

Three locations (GitHub recognizes all of them):

  1. CONTRIBUTING.md in the root. Obvious; visible immediately on clone.
  2. .github/CONTRIBUTING.md. Use this if the root is already crowded.
  3. docs/CONTRIBUTING.md. If you have a separate docs/ branch.

When someone opens an Issue or PR on GitHub, a "Read CONTRIBUTING guide" link appears in the right column. This only works when the file is in one of the three standard locations.

Pitfalls

  • "Pull requests welcome" in the README with an empty CONTRIBUTING file is a promise without instructions. A newcomer starts a PR without understanding the process, does it wrong, gets frustrated. That outcome is worse than "contributions closed."
  • CONTRIBUTING contradicts the README. The README says "Docker required"; CONTRIBUTING says "local Python needed." Walk through both every six months and keep them in sync.
  • CONTRIBUTING is outdated. It says make install but the project has used pnpm install for a year. A contributor spends an hour, opens an Issue saying "it doesn't work." The cycle repeats. Update CONTRIBUTING whenever the underlying infrastructure changes.

§ см. также

  • licenseLICENSE: project licenseThe LICENSE file in the repository root defines the terms for using the code. Without a license, code is closed by default under copyright: you can view a public repository on GitHub (GitHub Terms of Service permit that), but you cannot copy, modify, or distribute it until the author explicitly grants permission. The most common licenses are MIT, Apache-2.0, and GPL.
  • fork-vs-cloneFork vs cloneClone is a local copy of a repository. Fork is a copy **on the server** under your account. In open source you usually fork first (gaining write access to your copy), then clone the fork (to work locally), and open a PR from the fork back to the original.
  • pull-requestPull Request (PR)A request to merge a branch into the main branch after passing review and CI. On GitHub/GitLab/Bitbucket it is the standard mechanism for collaborative work. Technically it is not a Git command but a hosting feature built on top of branches and commits.
  • conventional-commitsConventional CommitsA commit message format: `<type>(<scope>): <subject>`. Enables automatic changelog generation and semver bump selection at release time. The standard dates from 2018 and is supported by most release tooling.
Footer
linuxlab-
Copyright © 2026 LinuxLab. All rights reserved.
Tutorials
Pricing
About
Privacy & cookies