Agent Skills in Claude Code and Visual Studio Code: Setup, Benefits, Risks, and a Step-by-Step Example
Understanding Git conceptually is useful, but the workflow becomes much clearer when you use it on a real repository.
In this guide, you will copy the GitHub repository created earlier in the series to your computer, edit a file in Visual Studio Code, record the change with Git, and send the new commit back to GitHub.
The complete workflow is:
Clone → Edit → Check status → Review changes → Stage → Commit → PushYou will also make a small change on GitHub and use git pull to bring it back to your local repository.
This tutorial uses a WSL terminal and a project stored inside the Linux file system. The Git commands themselves also apply to macOS and Linux. Windows PowerShell users can follow the same Git workflow, although paths and terminal setup will differ.
Version note: GitHub authentication screens, credential methods, and repository menus can change. Before publication, compare account and authentication steps with the current official Git and GitHub documentation.
By the end of this guide, you should be able to:
git status;git diff;git add;git commit;git log;git push;git pull;This article assumes that you already have:
The example repository name is:
vibe-coding-practiceReplace the username and repository name in examples with your own values.
Open your WSL terminal.
You can use the standalone Linux terminal or the integrated terminal in a VS Code window connected to WSL.
Run:
git --versionA successful result should resemble:
git version 2.x.xThe exact version will differ.
This confirms that the git command is available inside the current Linux environment.
Remember that software installed on Windows is not automatically installed inside WSL. If Git works in PowerShell but not in the WSL terminal, you may need a separate Linux installation.
On an Ubuntu-based WSL environment, Git can commonly be installed with:
sudo apt update
sudo apt install gitThe first command refreshes Ubuntu’s package information.
The second installs Git from the configured package repositories.
After installation, run the version check again:
git --versionDo not continue until the terminal recognizes the command.
Every Git commit contains author information.
At minimum, Git needs:
This information becomes part of the commit metadata.
Set your name with:
git config --global user.name "Your Name"For example:
git config --global user.name "Alex Kim"Set your email with:
git config --global user.email "your-email@example.com"Use an email strategy that matches the privacy settings selected in your GitHub account.
If you chose a GitHub-provided no-reply address, use that exact address instead of your personal email.
The --global option applies the setting to repositories used by your current Linux account.
Check the values:
git config --global user.name
git config --global user.emailGit should print the configured name and email.
You can also review the complete global Git configuration:
git config --global --listDo not publish terminal output containing private email addresses without reviewing it first.
A global identity applies broadly.
Some developers use a different identity for a specific project, such as a work repository.
Inside that repository, a local setting can be configured without --global:
git config user.name "Work Name"
git config user.email "work-email@example.com"The repository-specific value overrides the global value for that repository.
For this personal tutorial project, the global configuration is sufficient.
In the earlier WSL guide, we created:
~/projectsMove into that directory:
cd ~/projectsConfirm the location:
pwdThe result should resemble:
/home/your-username/projectsList the existing folders:
lsBefore cloning, confirm that a folder with the same name as the GitHub repository does not already exist.
If vibe-coding-practice already exists, do not immediately delete it. Check whether it contains work you need.
Open your repository on GitHub.
Find the repository’s clone or code menu.
GitHub commonly offers more than one connection method, including HTTPS and SSH. This beginner tutorial uses HTTPS because it requires less initial key configuration.
Copy the HTTPS repository URL.
It should follow a pattern similar to:
https://github.com/your-username/vibe-coding-practice.gitConfirm that:
Avoid pasting credentials, tokens, or private URLs into screenshots or public articles.
In the WSL terminal, run:
git clone https://github.com/your-username/vibe-coding-practice.gitReplace the example URL with the one copied from GitHub.
The clone command creates a local copy of the repository and its available Git history.
A successful result usually shows messages about:
After the command completes, list the directory contents:
lsYou should now see:
vibe-coding-practiceMove into the repository:
cd vibe-coding-practiceConfirm the location:
pwdThe path should resemble:
/home/your-username/projects/vibe-coding-practiceList the files:
lsYou should see the files already stored on GitHub, such as:
README.mdFrom inside the repository folder, run:
code .The period means the current directory.
VS Code should open the complete repository as a WSL workspace.
Verify the setup:
vibe-coding-practice;README.md appears in the Explorer.Inside the VS Code terminal, run:
pwdThe result should match the repository’s Linux path.
Then run:
git statusA clean newly cloned repository should normally display a message indicating that:
The exact wording and branch name may differ.
Cloning did more than copy files.
It also configured a connection to the GitHub repository.
Check the configured remote:
git remote -vThe output should show a remote named origin with a URL for fetching and pushing.
For example:
origin https://github.com/your-username/vibe-coding-practice.git (fetch)
origin https://github.com/your-username/vibe-coding-practice.git (push)origin is the conventional name Git gives the remote repository created during cloning.
Check the current branch:
git branch --show-currentThe command should print the active branch name.
You do not need to change branches in this tutorial.
Open README.md in VS Code.
Add a section such as:
## Local Git Practice
This repository is now connected to a local WSL development environment.
The current workflow includes:
- reviewing changes;
- staging selected files;
- creating small commits;
- pushing verified commits to GitHub.Save the file.
At this point:
Run:
git statusGit should report that README.md has been modified.
This is the working-directory state described in the previous article.
Before staging a file, inspect what changed.
Run:
git diffGit should display the difference between the current working file and the version in the last commit.
Added lines are commonly marked with +.
Removed lines are commonly marked with -.
The output may use a terminal viewer. Press q to exit when necessary.
Review the diff and ask:
This review habit becomes essential when AI tools begin editing multiple files.
To review only README.md, run:
git diff README.mdThis is useful when several files have changed.
git addStage README.md:
git add README.mdThis selects the current saved version of the file for the next commit.
Run:
git statusThe file should now appear under a section similar to:
Changes to be committedThe change is staged, but it has not yet entered permanent commit history.
Run:
git diff --stagedThis displays the changes currently prepared for the next commit.
This review is different from plain git diff.
git diff shows unstaged working-directory changes.git diff --staged shows changes selected for the next commit.For a small workflow, review the staged diff before every commit.
git add .You may see tutorials use:
git add .The period tells Git to stage changes under the current directory.
This is convenient, but it can also stage files you did not intend to include.
For beginners, staging specific files is often safer:
git add README.mdUse git add . only after checking git status and understanding every listed file.
Create a commit with:
git commit -m "Document local Git practice workflow"The -m option supplies the commit message directly.
A successful result should display information such as:
Now run:
git statusThe working tree should be clean again.
The change has been recorded in your local Git history.
It has not necessarily reached GitHub yet.
Run:
git logGit will display commit information, including:
The newest commit should appear first.
Press q to leave the log viewer.
For a shorter format, run:
git log --onelineThe result may resemble:
8f3a21d Document local Git practice workflow
2bc45ef Update README with repository status
91d2a07 Initial commitEach line represents one commit.
The short identifier can be used to reference a particular point in history.
A commit records history inside your local repository.
Git does not automatically send the commit to GitHub.
This separation allows you to:
The next step is pushing the commit to the configured remote.
Run:
git pushBecause the repository was cloned from GitHub, the current branch should already know which remote branch it tracks.
Git may ask you to authenticate.
Depending on the current GitHub and credential configuration, authentication may involve:
Do not enter your normal GitHub password into an authentication prompt unless the current official GitHub documentation explicitly requires that method. Git hosting authentication practices can change, and standard account passwords are not always accepted for Git operations.
Do not paste tokens into:
After authentication, a successful push should show that Git sent the new commit to the remote repository.
Open the repository page on GitHub and refresh it.
You should see:
Your local and remote repositories are now synchronized.
git statusReturn to the terminal and run:
git statusGit should report that the local branch is up to date with its remote tracking branch and that the working tree is clean.
You can also run:
git log --onelineCompare the newest local commit with the latest commit displayed on GitHub.
The identifiers should refer to the same commit.
To practice retrieving remote changes, edit the README through GitHub’s web interface.
Add a small section:
## Remote Update
This line was added through the GitHub web editor.Use a commit message such as:
Add remote update noteCommit the change through GitHub.
The GitHub repository now contains a commit that your local repository does not have.
Return to the WSL terminal.
Run:
git statusGit may still report a clean working tree because it has not yet checked the latest remote state.
A clean working tree means there are no uncommitted local file changes. It does not always mean the remote repository has no newer commits.
git pullRun:
git pullGit should contact the remote repository, download the new commit, and update the local branch.
For this simple case, the update should complete without a conflict because the local repository had no competing change.
Open README.md in VS Code.
The section added through GitHub should now appear locally.
Run:
git log --onelineThe remote commit should appear at the top of the local history.
Your local repository has caught up with GitHub.
A basic Git session can follow this sequence.
cd ~/projects/vibe-coding-practicegit pullPull before beginning when the repository may have changed elsewhere.
git statusUse VS Code or another editor.
git diffgit add README.mdgit diff --stagedgit commit -m "Describe the completed change"git status
git log --onelinegit pushThis workflow is compact, repeatable, and suitable for small AI-assisted tasks.
fatal: not a git repositoryThis means the current directory is not inside a Git repository.
Check your location:
pwdList the files:
lsMove into the cloned repository:
cd ~/projects/vibe-coding-practiceThen run:
git statusGit may refuse to clone when a nonempty folder with the target name already exists.
Do not delete the folder blindly.
Check its contents:
ls -la ~/projects/vibe-coding-practiceDetermine whether it is:
If it is already the correct Git repository, enter it and run:
git statusA commit may fail if user.name or user.email is missing.
Configure them:
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"Then try the commit again.
Check the current configuration:
git config user.email
git config --global user.emailA repository-specific value may override the global value.
Correct the configuration before creating future commits.
Changing author information in existing history is a separate task and should not be attempted casually in a beginner workflow.
git push Requests AuthenticationFollow GitHub’s current approved authentication process.
Verify:
Never publish authentication tokens.
git push Is Rejected Because the Remote Has New WorkThis usually means GitHub contains commits that are not yet in your local branch.
Start with:
git pullRead the output carefully.
If Git reports a conflict, do not repeatedly run random commands. Inspect which files conflict and resolve the differences deliberately.
Conflict resolution will be covered separately when the workflow requires it.
git statusThe file may be:
.gitignore;Check:
pwd
ls -la
git statusAlso confirm that VS Code and the terminal are using the same project folder.
If you accidentally staged files, do not create the commit yet.
Review:
git statusUse a non-destructive unstaging command appropriate to the current Git version and repository state, then stage only the intended files.
For example, Git commonly supports:
git restore --staged filenameAfter unstaging, the file remains in the working directory. Its content is not deleted.
Verify the result with:
git statusCommands such as git log and git diff may open a pager.
Press:
qto exit and return to the terminal prompt.
Before asking an AI coding tool to modify a project, run:
git statusThe cleanest starting point is a message indicating that the working tree is clean.
If uncommitted changes already exist, decide whether to:
Do not ask a coding agent for a large change when you do not know what is already modified.
After the AI finishes:
git status
git diffReview every changed file.
Then stage specific verified files:
git add path/to/fileReview again:
git diff --stagedOnly then create the commit.
This process turns Git into a review boundary:
Known state
→ AI change
→ Inspect
→ Test
→ Stage
→ CommitThe goal is not to commit every AI output. The goal is to commit only the output you have verified.
Before moving to the next article, confirm that you can:
git --version;git status;README.md;git diff;git add;git diff --staged;git log --oneline;git pull;The essential sequence is:
git status
git diff
git add README.md
git diff --staged
git commit -m "Describe the change"
git pushAt the start of a later session, include:
git pullThe basic Git workflow moves changes through several deliberate stages.
git clone creates a local repository from GitHub. git status shows the current state. git diff reveals what changed. git add selects changes for the next checkpoint. git commit records that checkpoint locally. git push sends the commit to GitHub, while git pull retrieves remote changes.
The important lesson is not memorizing every command. It is understanding what state the project is in before and after each command.
That awareness becomes especially valuable when AI tools begin editing the repository. Before accepting generated code, you need a reliable way to see what changed, test it, and preserve only the result you trust.
The next article will introduce GitHub Copilot inside Visual Studio Code. We will install the official extension, review sign-in and subscription requirements, try small contextual tasks, and examine AI suggestions before accepting them.
git add . or add files individually?Adding files individually is safer for beginners because it makes the next commit more deliberate.
Use git add . only after reviewing git status and confirming that every listed change belongs in the commit.
git commit upload my code to GitHub?No.
A commit records changes in the local repository. Use git push to send local commits to the connected GitHub repository.
git pull before every coding session?It is a useful habit when the repository may have changed on GitHub, another computer, or through another collaborator.
Before pulling, check that you do not have confusing uncommitted local changes.
Comments
Post a Comment