# Git

### (GT-100) Only Branch from Main

All branches must be created from the `main` branch

Rationale:

* Multiple levels of branching from the `main` branch can create opportunities for merge conflicts

Exceptions:

* None

### (GT-200) Feature Branch Naming

Repositories should only contain a single `main` branch and zero or more feature branches.

Feature branches must be named: `feature/<descriptive name>`

For example, if you're working on a feature that allows users to change the email address in their profile, the branch should be named `feature/change-email`

Rationale:

* Without a good naming convention, it is very easy to lose track of the purpose of a branch

Exceptions:

* None

### (GT-300) Delete Merged Branches

After a branch has been merged to master, it must be immediately deleted.

Rationale:

* Short-lived branches are a best-practice for minimizing merge conflicts. Leaving many branches active in a repository makes it difficult for team members to navigate the ongoing work. Once a branch has been reviewed, approved, and merged into the `main` branch, it should be immediately deleted.
* A healthy Git repository has a minimum of active branches.
* This is [easy to comply with using GitHub](https://help.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches).

Exceptions:

* None


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bloomtechlabs.gitbook.io/standards/coding/git.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
