Git without the terminal
VS Code has Git built in. You can do everything with clicks instead of commands.The Source Control panel
Look at the left sidebar in VS Code. You’ll see this icon:- Source Control icon (looks like a branch)
- Shows all your changed files
- One-click commits
Basic workflow
1. See your changes
Open the Source Control panel:- Changed files appear under “Changes”
- Click any file to see what changed
- Green lines = added
- Red lines = removed
2. Stage changes
Before committing, you “stage” files:- Hover over a file
- Click the + icon
- Or click + next to “Changes” to stage everything
3. Commit
Once files are staged:- Type a message in the text box
- Press
Ctrl/Cmd + Enter(or click ✓)
4. Push to GitHub
After committing:- Click the … menu in Source Control
- Click “Push”
- Or click the sync icon in the bottom status bar
Visual features
See changes inline
- Modified files show a colored bar in the editor
- Click the bar to see what changed
- Blue = modified, Green = added, Red = deleted
Common VS Code Git tasks
Initialize a new repo
Initialize a new repo
- Open your project folder
- Open Source Control panel
- Click “Initialize Repository”
- That’s it! Your project now uses Git
Clone a repository
Clone a repository
- Press
Ctrl/Cmd + Shift + P - Type “Git: Clone”
- Paste the GitHub URL
- Choose where to save
- VS Code opens it automatically
Create a .gitignore
Create a .gitignore
- Create new file:
.gitignore - VS Code suggests common patterns
- Or use Python template:
Discard changes
Discard changes
Made a mistake? Undo changes:
- In Source Control panel
- Right-click the file
- Select “Discard Changes”
- Confirms before reverting
Sync button magic
The status bar shows a sync button:- ↓ 3 means “3 commits to pull”
- ↑ 2 means “2 commits to push”
- Click it to sync everything
Tips for beginners
- Commit often: Every small feature or fix
- Write clear messages: “Fix login bug” not “changes”
- Pull before starting: Get latest changes first
- Don’t commit secrets: Check your .gitignore
Never commit
.env files or API keys! Always add them to .gitignore first.Terminal vs UI
Both work! Use what feels comfortable:| Task | Terminal | VS Code UI |
|---|---|---|
| Stage files | git add . | Click + icon |
| Commit | git commit -m "message" | Type message + Enter |
| Push | git push | Click sync |
| Pull | git pull | Click sync |
What’s next?
Now you know Git! Let’s learn about environment variables and keeping secrets safe.Environment & secrets
Keep your API keys safe