> For the complete documentation index, see [llms.txt](https://burkeholland.gitbook.io/vs-code-can-do-that/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://burkeholland.gitbook.io/vs-code-can-do-that/exercise-8-git-and-source-control/branching-and-merge-conflicts.md).

# Branching and merge conflicts

Working in feature branches is another common scenario. It's rare to code directly against master. Usually developers will create a branch, make their changes, and then merge the branch back into master.

{% tabs %}
{% tab title="Exercise" %}

* Create a new branch called "description\_fix"
* Modify the description in the "index.html" file
* Switch back to the master branch
* Change the description meta tags in the "index.html" file
* Merge in the "description\_fix" branch
* Resolve merge conflicts with VS Code
* Push changes to Github
  {% endtab %}

{% tab title="Answer" %}

* Click the "master" branch label in the status bar

![](/files/-Lm7RScLwrjnWJ_p5k0w)

* Select "Create new branch"

![](/files/-Lm7R_V6L4SNz_94FieI)

* Enter "description\_fix" as the branch name

![](/files/-Lm7ReDIU7upNJ2M0UBb)

* Change the content of the "description" meta tags to be "I ate a big red candle. I love lamp"

![](/files/-Lm7S27U-QaCijLPHH9Y)

* Stage and commit the changes to the branch as in the previous exercise
* Click on the "description\_fix" label in the status bar
* Switch back to the master branch

![](/files/-Lm7SEDaMXW2PV9MmOcm)

* Modify the "description" metatags to be "I enjoy lamp"

![](/files/-Lm7SY1wFvWXG2YUipYn)

* Stage and commit the changes to the master branch
* Open the Command Palette (**Cmd/Ctrl + Shift + P**)
* Select "Git: Merge Branch"

![](/files/-Lm7SmcP3h-NfIeRVDFH)

* Select the "description\_fix" branch
* VS Code will immediately warn that there are merge conflicts

![](/files/-Lm7TPb4ld_XrhJoAzfb)

* Select "Accept incoming change"

![](/files/-Lm7TWDpR2Eafy0kTnbX)

* Open the Command Palette (**Cmd/Ctrl + Shift + P**)
* Select "Git: Delete Branch"
* Delete the "description\_fix" branch

![](/files/-Lm7TjJ3uznOdlzPnH-4)

{% endtab %}
{% endtabs %}


---

# 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://burkeholland.gitbook.io/vs-code-can-do-that/exercise-8-git-and-source-control/branching-and-merge-conflicts.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.
