# Git Conventions

Branch naming rules, commit message format, and Gitmoji conventions for the Ledger Wallet repository.

---

## Branch Naming

- Use **short, clear and descriptive names** that provide immediate context. For example: `feature/login` or `fix/navbar-overflow`.
- Use **hyphens** to separate words: `fix/login-issue` is preferred over `fix/LoginIssue` or `fix/login_issue`.
- Use only **lowercase alphanumeric characters** (a-z, 0-9) and hyphens.
- Use **prefixes** for organization:

| Prefix                | Purpose                                          |
| --------------------- | ------------------------------------------------ |
| `feature/` or `feat/` | Creating new features                            |
| `fix/`                | Addressing code bugs                             |
| `doc/`                | Updating, modifying, or correcting documentation |

- Add **ticket numbers** if your project uses an issue tracking system. If there is no ticket number, use `no-issue`.

**Example:** `feature/PROJ-123-footer-links`

---

## Commit Messages

### Format

The commit message is composed of:

1. The `doc`, `feature`, or `fix` prefix between parentheses
2. The related ticket number or `NO-ISSUE` between brackets
3. A short description

### Gitmoji

We recommend using [Gitmoji](https://gitmoji.dev/) to write commit messages.

| Emoji          | Usage                                |
| -------------- | ------------------------------------ |
| :tada:         | Begin a project                      |
| :construction: | Work in progress                     |
| :memo:         | Add or update documentation          |
| :pencil2:      | Fix a typo                           |
| :sparkles:     | Implement a new feature              |
| :bug:          | Fix a bug                            |
| :recycle:      | Refactor code                        |
| :wastebasket:  | Deprecated code needed to be removed |
| :mag:          | Improve SEO                          |

### Example

With Gitmoji and the naming convention, the commit looks like:

```
📝(doc) [NO-ISSUE]: DMK video presentation
```

---

## See also

- [How to Structure a Feature](../how-to/structure-a-feature) — Includes guidance on when to use `feature/` vs `fix/` branches
