> For the complete documentation index, see [llms.txt](https://johnoraw.gitbook.io/iac-version-control/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnoraw.gitbook.io/iac-version-control/github/windows/integrate-vscode.md).

# Integrate VSCode

Everything I’m doing here uses Git, but also ties into GitHub.&#x20;

I open Visual Studio Code and select a folder which has an existing repo cloned from GitHub and open a file.&#x20;

In the terminal window, I select **Output** and **Git**.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/P31KM1RTri1upKXV5p0F/image.png" alt=""><figcaption></figcaption></figure>

I make a small edit to the file and click **Save**. The filename changes colour, signalling that it has been changed.&#x20;

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/ewMXiGIYLXLECwXbWaYP/Screenshot%202023-11-08%20095516.jpg" alt=""><figcaption></figcaption></figure>

I click on **Source Control**, and I can see the changed file.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/QMaU1aTI6P2BbkAahy4F/Screenshot%202023-11-08%20095730.jpg" alt=""><figcaption></figcaption></figure>

I have options to **discard** (curvy arrow) or **add** (+), hover over them to distinguish.&#x20;

If I **add**, I can see a new tab, **Staged Changes**.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/WFbNqs8nuBwXqFxewljC/Screenshot%202023-11-08%20100006.jpg" alt=""><figcaption></figcaption></figure>

If I click on the menu (three dots) I can see the Git commands.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/bwRbo37Y3JhNTx6sECtv/Screenshot%202023-11-08%20100206.jpg" alt=""><figcaption></figcaption></figure>

I click **Commit** and then **Commit staged** and I’m prompted for a message; I add a message.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/gokrPWm3ORfQYVpPh2F3/image.png" alt=""><figcaption></figcaption></figure>

My local Git repo is now clean, but is one revision ahead of the origin, my GitHub repo.

I can now **Sync** changes.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/ubcZptgvHAESpSObEBhz/Screenshot%202023-11-08%20100632.jpg" alt=""><figcaption></figcaption></figure>

If I monitor the output, I can see the detail of the push to the repo.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/7fanlWrDuZAG7auivZw2/image.png" alt=""><figcaption></figcaption></figure>

And I can verify on GitHub.

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/N1jJT1Vsmfb06RLaavQ1/image.png" alt=""><figcaption></figcaption></figure>

## Exercise&#x20;

Using one of your repos, make sure you can edit in VSCode, add, commit, and push. Verify all this as I did.
