In this categoryVS Code Setup ยท 25
- How to Set Up GitHub Copilot in VS CodeStart
- How to Use Copilot Chat and Inline Chat in VS Code
- How to Install and Manage Extensions in VS Code
- How to Install the Continue Extension in VS Code
- How to Install Cline, the Autonomous Coding Agent, in VS Code
- How to Configure Continue with an API Model
- How to Set Up an AI Assistant in VS Code
- How to Run Continue with a Local Model Using Ollama
- How to Run Copilot, Continue, and Cline Together Without Conflicts
- How to Add an MCP Server to Cline
- How to Fix AI Suggestions Not Appearing in VS Code
- How to Install and Trust an AI Extension in VS Code
- How to Install a VS Code Extension from the Command Line
- How to Create a launch.json to Debug a Node.js App in VS Code
- How to Initialize a Git Repository in VS Code
- How to Stage, Commit, and Push Changes from VS Code
- How to Debug a Browser App in VS Code with the Built-in Chrome Debugger
- How to Resolve Git Merge Conflicts in VS Code
- How to Run Build and Dev Commands with tasks.json in VS Code
- How to Add Environment Variables to a VS Code Debug Configuration
How to Stage, Commit, and Push Changes from VS Code
Run the everyday git loop, review a diff, stage selectively, commit, and push to a remote, entirely from the Source Control view.
Once a repository is set up, your daily rhythm is the same: review what changed, stage the parts you want, write a commit message, and push to your remote so the work is backed up and shareable. VS Code makes each step a click. This guide walks the full loop, including reviewing the diff before you commit so you actually know what you are saving.
What you need
- A git repository open in VS Code with some uncommitted edits
- A remote already connected (for example a GitHub repo)
- Your git identity configured
Step 1: Review what changed
Open Source Control with Ctrl+Shift+G. Click any file under Changes to open a side-by-side diff: the old version on the left, your edits on the right, with additions in green and removals in red. Read the diff before committing so you do not save accidental changes.
Step 2: Stage the changes you want
Staging is choosing which changes go into the next commit. Hover a file under Changes and click the plus icon to stage it, or click the plus next to Changes to stage everything. Staged files move to a Staged Changes group. You can stage just part of a file by selecting lines in the diff and choosing Stage Selected Ranges.
Step 3: Write a commit message and commit
Type a clear message in the box at the top of the Source Control view. A good message says what changed and why in one line. Click the Commit checkmark, or press Ctrl+Enter. The staged changes become a permanent snapshot.
Step 4: Push to the remote
A commit only lives on your machine until you push it. Click the Sync Changes button at the bottom status bar, or open the three-dot menu in Source Control and choose Push. If you prefer the terminal, the same thing happens with one command.
Step 5: Confirm the sync
After pushing, the status bar shows 0 outgoing changes. The small numbers next to the sync icon tell you how many commits you have to push (up arrow) or pull (down arrow) at any time.
Result
You reviewed your diff, staged exactly what you wanted, committed it with a clear message, and pushed it to your remote. That is the loop you will repeat dozens of times a day, all from one panel.
Watch related tutorials
35:00
18:22
1:42:18
28:14
41:09
9:47New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.