Git is a version control system that allows you to track changes in your code, collaborate with team members, and manage your Assistant Extensions efficiently.
If you're new to Git, this guide introduces the core concepts and shows you how to use GitHub as your remote repository platform along with Visual Studio Code.
Git is a distributed version control system. It tracks changes in your files and allows you to:
Each time you commit, you create a snapshot of your project at that point in time.
A repository (repo) is a project tracked by Git.
You will work with two types:
GitHub hosts your remote repository so you can collaborate and store your code safely.
Core workflow concepts:
mainUnderstanding these clearly is critical.
GitHub is a cloud-based platform that hosts Git repositories and provides collaboration tools like pull requests, issues, and code reviews.
You will use GitHub as your remote repository for storing and managing Assistant Extension projects.
You now have an empty remote repository.
If your project folder is not already a Git repository, initialize it.
Open the integrated terminal in VS Code and run:
git init
git add .
git commit -m "Initial commit"
Explanation:
git init creates a local repositorygit add . stages all filesgit commit creates your first snapshotAfter creating the repository on GitHub, copy the remote URL and run:
git remote add origin https://github.com/{yourUsername}/{repositoryName}.git
git branch -M main
git push -u origin main
Replace:
{yourUsername} with your GitHub username or organization{repositoryName} with your extension IDThis:
mainIf authentication fails, GitHub may require a Personal Access Token or browser authentication.
Avoid developing directly on main when working in a team.
Create a feature branch:
git checkout -b feature/my-new-feature
After making changes:
git add .
git commit -m "Add new feature"
git push -u origin feature/my-new-feature
Then:
Before starting new work:
git checkout main
git pull origin main
Pull regularly to avoid merge conflicts.
Visual Studio Code provides built-in Git support:
Official documentation:
https://code.visualstudio.com/docs/sourcecontrol/overview
You should be able to confidently: