> For the complete documentation index, see [llms.txt](https://cumbucadev.gitbook.io/github-essentials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cumbucadev.gitbook.io/github-essentials/dia-10/atualizando-um-repositorio-local-apos-mesclagem.md).

# Atualizando um Repositório Local Após Mesclagem

Após a mesclagem de um Pull Request (PR) no repositório remoto, é essencial atualizar seu repositório local para garantir que você esteja trabalhando com a versão mais recente do código. Seguir esses passos evita conflitos e garante que suas futuras contribuições estejam alinhadas com a base de código principal.

## Passos

### 1. Mudar para o branch principal

Antes de atualizar o repositório local, certifique-se de que está no branch principal `main`. Para alternar para ele, execute:

```bash
git checkout main
```

### 2. Baixar as últimas alterações do repositório remoto

Agora, atualize seu branch principal baixando as últimas mudanças do repositório remoto:

```bash
git pull origin main
```

Isso garante que seu repositório local esteja sincronizado com as alterações feitas remotamente, incluindo o seu PR recentemente mesclado.

### 3. Remover branches locais obsoletos

Como o branch da feature já foi excluído no repositório remoto, você pode removê-lo do seu ambiente local com:

```bash
git branch -d nome-da-branch
```

***

Seguindo esses passos, seu repositório local estará atualizado e pronto para o próximo ciclo de desenvolvimento. Agora, você poderá iniciar uma nova tarefa com um ambiente limpo e sincronizado com o repositório remoto.


---

# 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://cumbucadev.gitbook.io/github-essentials/dia-10/atualizando-um-repositorio-local-apos-mesclagem.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.
