BOWLING GREEN STATE UNIVERSITYDepartment of Computer Science
AI+X Learning Resources

Version Control with AI

Version control saves every version of your work, each with a short note, so you can see what changed and go back when something breaks. First set up VS Code and GitHub Copilot (Lesson 5, steps 1 to 3).

GitHub Copilot can explain each step and even run it for you. Read every command before you click Allow.

Watch the lesson

Video, 7:10. Turn on captions with the CC button.

Step-by-step videos

Step 1: Make a folder and track it

Open a new folder, let Copilot make a study plan, then make the first commit.

Video, 1:06

Step 2: Put it on GitHub

Publish the folder as a private repository.

Video, 0:27

Step 3: Change, commit, sync

Save a change, commit it with a note, and sync it to GitHub.

Video, 0:41

Let AI help: Explain a step

Ask Copilot what a button just did, then check its answer.

Video, 0:45

Let AI help: Write the note

The sparkle button suggests a commit note. Read it before you commit.

Video, 0:31

Let AI help: Let it commit and push

Copilot runs the commands after you allow each one.

Video, 0:57

Step 4: Try an idea on a branch

Make a branch, change the plan, then merge it into main.

Video, 1:29

Undo a change

Undo a commit you have not synced, or revert one that is on GitHub.

Video, 1:13

Sample prompts

  1. Open a new, empty folder in VS Code and trust it.
  2. In the Copilot Chat panel, choose Agent and paste Prompt 1 to make the study plan file.
  3. Use Prompts 2 and 3 to ask Copilot about a step. Check its answer against your screen.
  4. Prompts 4 and 7 ask Copilot to run Git commands for you. Read each command before you click Allow.
  5. Prompt 7 needs a commit named Move quiz to Friday. Change the name if yours is different.

Prompt 1: Create the study plan file

Download .txt: Prompt 1: Create the study plan file
Show the full prompt
Create a file called study-plan.txt with exactly these three lines and nothing else:
Monday: Read chapter 5.
Tuesday: Make flashcards.
Wednesday: Take a practice quiz.

Prompt 2: Ask what Initialize Repository did

Download .txt: Prompt 2: Ask what Initialize Repository did
Show the full prompt
I just clicked Initialize Repository in Source Control. What did it do? Answer in two short sentences.

Prompt 3: Private or public?

Download .txt: Prompt 3: Private or public?
Show the full prompt
Should I publish this as a private or a public repository? Answer in two short sentences.

Prompt 4: Commit and push for me

Download .txt: Prompt 4: Commit and push for me
Show the full prompt
Commit my change to study-plan.txt with a short message that says what changed, then push it to GitHub.

Prompt 5: Change the plan on a branch

Download .txt: Prompt 5: Change the plan on a branch
Show the full prompt
Change study-plan.txt: replace "Take a practice quiz" on Wednesday with "Review chapter 5 again", and add a last line "Friday: Take a practice quiz." Change nothing else.

Prompt 6: How do I undo a commit?

Download .txt: Prompt 6: How do I undo a commit?
Show the full prompt
I made a commit by mistake and have not synced it yet. How do I undo it in VS Code? Answer in two short sentences.

Prompt 7: Revert a commit

Download .txt: Prompt 7: Revert a commit
Show the full prompt
Undo the commit "Move quiz to Friday" with git revert --no-edit. Do not change anything else.

Prompt 8: Explain the history

Download .txt: Prompt 8: Explain the history
Show the full prompt
Explain the history of this project in plain words. List each saved version, newest first, with one short sentence each.