# GitFlow

## Como trabalhar com branches git flow

### Branches

**master:** administrada pelo SRE, é a branch de produção; \
**release:** branch que precede a master, é formado pelo merge das branches de features; \
**feature:** utilizada para commitar as tarefas de uma função do sistema; \
**hotfix:** branch utilizada para correções de bugs.

### Como trabalhar nas branches

Na pasta do projeto **git**, crie a sua branch com a sintaxe nome\_branch/nome\_tarefa. Exemplo:

```
$git checkout -b feature/nome_feature
```

Os commits nesta branch, iniciarão com o número da issue, para que todos os commits sejam linkados com a issue.&#x20;

```
$git commit -m "#n - descrição" 
```

Para enviar os commits, não esqueça de dar o push com a origin:&#x20;

```
$git push origin feature/nome_feature
```

Na issue, ficará deste jeito:&#x20;

![](/files/-LQ1JCHKQWgQDoJZSBPc)

### Concluindo a sua tarefa e fazendo pull request

Após as concluir suas tarefas pertencentes aquela branch, será necessário fazer um pull request para a branch **release**. Sua tela inicial do git, será como esta:&#x20;

![](/files/-LQ1JFDkSz1rsHWpz87T)

&#x20;Clicando em Compare & pull request, irá para tela de pull request (próxima imagem), nela você escolherá a branch que irá fazer o pull request (a da esquerda) que será a **release**. Após a escolha, descreva o que foi feito e peça o pull request.

![](/files/-LQ1JIUED51Ched2FzG3)

Após o procedimento, o pull request será negado ou aceito, no caso se aceito, clique em **merge pull request**.&#x20;

![](/files/-LQ1JL8UR0TMyiNqk9_K)

Após isso, virá para esta tela, então poderá deletar a branch com o botão **delete branch**.&#x20;

![](/files/-LQ1JNfu66Ptdan9yEeQ)


---

# 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://academiadev.gitbook.io/joinville/pull-request/gitflow.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.
