> 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/common-git-workflows.md).

# Common Git workflows

Git is a powerful tool, but it can be quite confusing. There are a lot of commands to remember, and resolving conflicts is just a complicated concept in general. In this exercise, you'll learn the most common and easiest to use workflow for Git within VS Code.

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

* Modify both of the meta tag descriptions in the "index.html" file&#x20;
* Stage both files
* Commit both files
* Push changes to Github
  {% endtab %}

{% tab title="Answer" %}

* Open the "index.html" file

![](/files/-Lm7NHG2V0GOTUvTCMSv)

* Highlight "I LOVE LAMP" on line 7 and press **Cmd/Ctrl + D** to add a cursor to the second instance on the line below.

![](/files/-Lm7NV-mQ39BhFoh7ti6)

* Change the value to "I love lamp"

![](/files/-Lm7NfzTpPQICw1HrUrV)

* Open the Source Control Explorer view (**Ctrl + Shift + G**)
* Click the "+" button next to the "index.html" file to stage it

![](/files/-Lm7OFk4Tun0q2EGU89p)

* Add a message to the "Message" box and press **Cmd/Ctrl + Enter**

![](/files/-Lm7OUYIQAiGmxVSFgOs)

* Undo the commit by pressing the ellipsis in the top right corner and select "Undo Last Commit"

![](/files/-Lm7OoTBL9U8QTR8kOAV)

* Change the commit message to "Better description"
* Press **Cmd/Ctrl + Enter** to commit&#x20;
* Use the button the bottom status bar to push changes to your repo

![](/files/-Lm7PKTOQrP29DrIWA7N)

* Open the Settings file (**Cmd/Ctrl + ,**)
* Add the following line so that VS Code can automatically tell you how many commits you are ahead of or behind the repo.

```
"git.autofetch": true
```

{% 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/common-git-workflows.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.
