> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/devops/devops-pt-br/codigo/gerenciando-branches/criando-uma-branch.md).

# Criando uma branch

Crie uma nova branch a partir de uma branch de origem existente para gerenciar trabalho de desenvolvimento isolado.

## ![](https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) Visão geral <a href="#overview" id="overview"></a>

As branches no DevOps permitem que os desenvolvedores isolem alterações, testem novos recursos e façam deploy com segurança. Você pode criar uma nova branch a partir de uma origem existente, como main ou outra branch de funcionalidade. Este artigo explica como criar uma nova branch.

{% hint style="info" %}

### Benefícios de Criar Branches

Criar branches no seu processo de desenvolvimento traz várias vantagens:

* **Alterações isoladas:** Todos os commits e alterações podem ser feitos de forma isolada, sem impactar outras branches.
* **Flexibilidade de merge:** As branches podem ser integradas a outras branches por meio de pull requests.
* **Desenvolvimento de funcionalidades:** Desenvolva novos recursos sem interferir na linha principal de desenvolvimento.
* **Preparação de hotfix:** Crie branches dedicadas para correções urgentes em produção.
* **Estabilização da release:** Use branches de release para testar e estabilizar o código antes do deploy.
  {% endhint %}

## Criando uma Nova Branch

{% stepper %}
{% step %}

### Nome da Branch

1. Clique em **Branches** no menu da barra lateral esquerda.
2. Clique em **Criar Branch**.

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F25KCFh4LpcqkO5TszE2k%2FCreatingABranch-S01-01.png?alt=media&amp;token=57550e7c-1041-46b5-a02b-bdc1a8df1a13" alt="" width="563"><figcaption></figcaption></figure></div>
3. Em **Nome da nova branch** caixa de texto, insira um nome descritivo para a branch.

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FRmLhcKhFXvS3hWsPTUTd%2FCreatingABranch-S01-02.png?alt=media&amp;token=a2c2e363-9125-44b6-b7ef-85ccac322649" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Escolher origem

Por padrão, a maioria das novas branches é criada a partir de **main** pois ela está sincronizada com a Produção. No entanto, você pode selecionar a origem com base em onde deseja iniciar sua nova branch, garantindo que ela comece com o contexto certo para o seu trabalho.

<table><thead><tr><th width="100.33331298828125">Branch</th><th>Use quando</th></tr></thead><tbody><tr><td>Main</td><td>Iniciando um novo trabalho alinhado com a Produção.</td></tr><tr><td>Release</td><td>Seu trabalho deve incluir todas as alterações já mescladas e preparadas para a release.</td></tr><tr><td>Feature</td><td>Colaborando com outro desenvolvedor, de modo que sua branch herde as alterações em andamento dele, em vez de começar do zero.</td></tr></tbody></table>

1. Clique no **branch de origem** menu suspenso.
2. Pesquise ou navegue pela branch de origem desejada.
3. Selecione uma branch de origem a partir da qual ramificar (comumente a **main** branch).

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FYuNixTUuGUD1xqcMG8hW%2FCreatingABranch-S02-01.png?alt=media&amp;token=8932ddf5-f806-4c1a-a459-2414ff7b4458" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Integração com Jira

Se o seu DevOps estiver integrado ao **Jira**, você pode selecionar:

* **Integração** - A conta do Jira a ser usada.
* **Projeto** - Vincule a um projeto específico do Jira.
* **Histórias** - Anexe histórias de usuário do Jira à branch.

  <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FkOQM51Lz0GKJXCkZMkuT%2FCreatingABranch-S03-01.png?alt=media&amp;token=8b7b53ba-6102-4947-b9bb-45669468fd1a" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Para obter instruções completas sobre como criar uma branch integrada ao Jira, veja o artigo a seguir.

* \[Em breve] Criando uma Branch com Integração ao Jira
  {% endhint %}
  {% endstep %}

{% step %}

### Criar uma Nova Branch

1. Clique em **Criar branch**.

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FD3K9OYZCI3w9J7EXYonL%2FCreatingABranch-S04-01.png?alt=media&amp;token=a2621ac0-a159-4640-8f1c-80bf0b6352c5" alt="" width="563"><figcaption></figcaption></figure></div>
2. Depois que a branch for criada, você será levado à **Componentes** aba.

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FXfncbhK5iUVtcFGG2WZE%2FCreatingABranch-S04-02.png?alt=media&amp;token=3b5b10bb-17df-4fbe-9e7d-0b7e3fe4bedc" alt="" width="563"><figcaption></figcaption></figure></div>
3. A nova branch é listada na **Branches** página.

   <div align="left"><figure><img src="https://2465342021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2Fy2Aec4Aq1V5b4p6ZA9H4%2FCreatingABranch-S04-03.png?alt=media&amp;token=ab1dbd2a-f3e5-4a5f-bb89-ade0051f5923" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.flosum.com/devops/devops-pt-br/codigo/gerenciando-branches/criando-uma-branch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
