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