> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/go-gitea/gitea/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing to Gitea

> Learn how to contribute to Gitea development - from reporting issues to submitting pull requests

## Introduction

Gitea welcomes contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or translating the interface, your help is appreciated.

<Note>
  Before starting work on a significant change, please discuss it in an issue first to ensure alignment with the project's goals.
</Note>

## Ways to Contribute

<CardGroup cols={2}>
  <Card title="Report Bugs" icon="bug">
    Help identify and document bugs in the issue tracker
  </Card>

  <Card title="Fix Issues" icon="wrench">
    Contribute code fixes for existing issues
  </Card>

  <Card title="Add Features" icon="plus">
    Propose and implement new features
  </Card>

  <Card title="Improve Docs" icon="book">
    Enhance documentation and examples
  </Card>

  <Card title="Translate" icon="language">
    Help translate Gitea into other languages
  </Card>

  <Card title="Review Code" icon="code-review">
    Participate in code review for pull requests
  </Card>
</CardGroup>

## Getting Started

<Steps>
  <Step title="Fork the Repository">
    Fork [go-gitea/gitea](https://github.com/go-gitea/gitea) on GitHub
  </Step>

  <Step title="Clone Your Fork">
    ```bash theme={null}
    git clone https://github.com/YOUR_USERNAME/gitea.git
    cd gitea
    ```
  </Step>

  <Step title="Add Upstream Remote">
    ```bash theme={null}
    git remote add upstream https://github.com/go-gitea/gitea.git
    ```
  </Step>

  <Step title="Create Feature Branch">
    ```bash theme={null}
    git checkout -b feature/my-new-feature
    ```
  </Step>
</Steps>

## Development Workflow

### Making Changes

<Steps>
  <Step title="Keep Your Fork Updated">
    ```bash theme={null}
    git fetch upstream
    git checkout main
    git merge upstream/main
    ```
  </Step>

  <Step title="Make Your Changes">
    Edit the code, add tests, and update documentation
  </Step>

  <Step title="Format and Lint">
    <Tabs>
      <Tab title="Go Code">
        ```bash theme={null}
        # Format Go code
        make fmt

        # Lint Go code
        make lint-go
        ```
      </Tab>

      <Tab title="Frontend Code">
        ```bash theme={null}
        # Lint JavaScript/TypeScript
        make lint-js
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Run Tests">
    ```bash theme={null}
    # Run all tests
    make test

    # Run specific test package
    go test ./modules/git/...
    ```
  </Step>
</Steps>

### Commit Guidelines

Follow these conventions for commit messages:

```bash theme={null}
# Format: <type>: <description>
#
# Types:
# - feat: New feature
# - fix: Bug fix
# - docs: Documentation changes
# - style: Code style changes (formatting)
# - refactor: Code refactoring
# - test: Adding or updating tests
# - chore: Maintenance tasks

# Example commit messages:
feat: Add support for Git LFS v3 protocol
fix: Resolve issue with webhook delivery retries
docs: Update installation guide for Docker
refactor: Simplify user authentication logic
```

<Warning>
  Add the current year to the copyright header when creating new `.go` files.
</Warning>

### Submitting Pull Requests

<Steps>
  <Step title="Push Your Branch">
    ```bash theme={null}
    git push origin feature/my-new-feature
    ```
  </Step>

  <Step title="Create Pull Request">
    Go to GitHub and create a pull request from your fork to `go-gitea/gitea:main`
  </Step>

  <Step title="Fill Out PR Template">
    Provide:

    * Clear description of changes
    * Related issue numbers (use `Fixes #123` for automatic closing)
    * Screenshots/videos for UI changes
    * Testing performed
  </Step>

  <Step title="Address Review Feedback">
    Work with maintainers to refine your PR
  </Step>
</Steps>

## Code Review Process

### PR Requirements

* **Tests**: Add tests for new functionality
* **Documentation**: Update docs for user-facing changes
* **Commits**: Clean commit history (squash if needed)
* **Conflicts**: Resolve merge conflicts
* **DCO**: All commits must be signed off (Developer Certificate of Origin)

### Getting PR Merged

<Accordion title="PR Approval Process">
  1. **Review**: PRs require review from maintainers
  2. **Testing**: Automated tests must pass
  3. **Approval**: At least one maintainer approval required
  4. **Merge**: Maintainers will merge approved PRs
</Accordion>

<Accordion title="Stale PRs">
  PRs with no activity for 60 days may be closed. You can always reopen if you resume work.
</Accordion>

## Developer Certificate of Origin (DCO)

All commits must include a `Signed-off-by` line:

```bash theme={null}
# Add to individual commit
git commit -s -m "feat: Add new feature"

# Or configure Git to always sign off
git config --global format.signoff true
```

This certifies that you have the right to submit the code under the project's license (MIT).

## Coding Standards

### Go Code

* Follow [Effective Go](https://golang.org/doc/effective_go.html)
* Use `gofmt` for formatting (enforced by `make fmt`)
* Add comments for exported functions and types
* Write tests for new code
* Handle errors explicitly

### Frontend Code

* Follow the ESLint configuration
* Use TypeScript for type safety
* Write accessible HTML
* Test in multiple browsers

### Database Migrations

* Create migrations for schema changes
* Test both upgrade and downgrade paths
* Support all database backends (PostgreSQL, MySQL, SQLite, MSSQL)

## Translation

Help translate Gitea through [Crowdin](https://translate.gitea.com):

<Steps>
  <Step title="Join Crowdin">
    Create an account on Crowdin and join the Gitea project
  </Step>

  <Step title="Select Language">
    Choose the language you want to translate
  </Step>

  <Step title="Translate Strings">
    Translate untranslated strings or improve existing translations
  </Step>

  <Step title="Review">
    Participate in translation review and discussion
  </Step>
</Steps>

## Security Issues

<Warning>
  **Do not report security issues publicly.** Send them privately to [security@gitea.io](mailto:security@gitea.io)
</Warning>

## Community

Connect with other contributors:

* **Discord**: [Join the Gitea Discord](https://discord.gg/Gitea)
* **Forum**: [Discourse Forum](https://forum.gitea.com/)
* **GitHub Discussions**: [go-gitea/gitea discussions](https://github.com/go-gitea/gitea/discussions)

## Resources

<CardGroup cols={2}>
  <Card title="Building from Source" href="/development/building">
    Set up your development environment
  </Card>

  <Card title="Testing Guide" href="/development/testing">
    Learn how to write and run tests
  </Card>

  <Card title="Architecture" href="/development/architecture">
    Understand Gitea's architecture
  </Card>

  <Card title="CONTRIBUTING.md" href="https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md">
    Full contribution guidelines on GitHub
  </Card>
</CardGroup>

<Info>
  For detailed contribution guidelines, see [CONTRIBUTING.md](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md) in the repository.
</Info>
