Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To use Git in Visual Studio Code, install Git separately, open or clone a repository, then use the Source Control view to review changes, stage the work you want included, and commit it. A commit stays in local Git history; pushing is a separate action that uploads commits to a remote repository. Once you understand that distinction, VS Code’s buttons and commands are much easier to use safely.

What do I need before using Git in VS Code?

You need Visual Studio Code and Git installed on your computer. VS Code provides the interface for Git operations, but it uses the official Git distribution installed on your machine; installing VS Code alone does not install Git.

  • Install Git using the official Git distribution for your operating system.
  • Open the integrated terminal in VS Code and run git --version. A version response confirms that the terminal can find Git.
  • Set the name and email Git should record on your commits if they are not already configured.

Use the terminal commands below to set a default identity for your user account:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Replace the example values with the name and email you want attached to commits. The --global option applies the identity across your repositories for that user account; without it, Git configuration can instead be set for a particular repository. This identity is commit information, not proof that you have permission to write to a hosted project.

Popular on Amazon
Silkland 40Gbps USB C 90 Degree Right Angle Adapter 2 Pack, 240W USB4 | Male to Female Extender, 8K@60Hz, Thunderbolt 4/3, Steam Deck, ROG Ally, MacBook, Switch 2, iPhone 18/17/16/15, Quest 3 VR
  • 【90 Degree Full Function USB C Adapter】Supports the latest USB4 standard for up to 40Gbps of bandwidth, 8K video support, and up to 240W Fast charging; Support USB PD 3.1 Extended Power Range (EPR) including 140W, 180W and 240W. Your productivity is easily doubled. *Warm Tip: For the best fit, please make sure the USB-C port is fully exposed; thick or bulky cases may affect compatibility.
  • 【Reliable Quality】Made from high-quality, scratch-resistant aluminum alloy, delicate metal frame. get excellent wear resistance and heat dissipation. Non-Slip Design for easier insertion and removal.
  • 【Small and portable】Ultra thin size, ultra compact design, a petite physique that matches the minimalist design of your modern laptops. Coming with a slim figure that won't block the port next to the one it's plugged into.
  • 【Compatibility】Widely work with most usb c, thunderbolt 4/3 devices. Compatibilit for ROG Ally, Steam Deck, Switch, MacBook Pro, Quest 3 VR headset, Surface Book 2, iPhone 18/17/16/15, Samsung Galaxy S23/S22/S21, Note 20/10, Google Pixel, ChromeBook, etc.
  • 【Excellence Customer Support】If you experience any issues or cable failure, simply reach out to our dedicated customer service team. We provide a prompt response within 18 hours, providing you with the necessary technical support to resolve any concerns.

VS Code’s built-in Git integration uses the installed Git program, so it is useful to confirm Git is available before troubleshooting the editor. If git --version does not return a version, Git may not be installed or the terminal may not be able to find it. Once Git is available, the Source Control view is the central interface for reviewing changes, staging, committing, working with branches, and synchronizing with remotes.

How do I start a Git repository in VS Code?

For an existing repository, open its folder in VS Code. For a new project, initialize Git in the project folder so Git can track its changes.

Open an existing local repository

  1. In VS Code, choose File > Open Folder and select the repository folder.
  2. Open the Source Control view from the Activity Bar. If the folder is a Git repository, VS Code displays its changes and repository controls there.

Initialize a new repository

  1. Open the project folder in VS Code.
  2. Open the Source Control view and choose Initialize Repository. Alternatively, open the Command Palette and run Git: Initialize Repository.
  3. Review the files Git lists as changes before creating the first commit.

Initialization creates local Git history for that folder. It does not automatically create a hosted copy or share the project with anyone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After initialization, the files you see under Changes are content Git can review for the first commit. Treat that first review as an important check: confirm the files belong in version history before staging them. A local repository is useful even if you do not plan to collaborate online; a remote is an additional destination for sharing and receiving commits, not a requirement for making local commits.

How do I commit changes in VS Code?

Review the changes, stage the content you want in the next snapshot, enter a commit message, and choose Commit in Source Control. Saving a file is not a commit: saving writes the file to disk, while a commit records staged content in the repository’s local history.

  1. Save your edits. Git compares the working files with the last committed version; saving alone does not record a commit.
  2. Inspect the changes. In Source Control, look under Changes and select a file to open its diff. The diff shows what has changed so you can review it before deciding what to include.
  3. Stage what belongs together. Stage a whole file or, when you want finer control, selected lines from its diff. Staging marks content for the next commit; it does not create the commit yet.
  4. Write a concise commit message. Describe the change the staged content makes, rather than writing a generic message such as “updates.”
  5. Choose Commit. Git records the staged snapshot in local history. If other unstaged changes remain, they are not part of that commit.

The three actions have different outcomes: saving updates a working file, staging selects content, and committing records that selection in local history. A commit is not uploaded until you push it to a remote.

Staging is useful when a file contains more than one kind of change or when you want to control the exact content in a commit. You can stage an entire file when all of its changes belong together, or stage selected lines when only part of the diff is ready. Before committing, check the staged diff rather than assuming the whole working folder will be recorded. The next commit contains staged content, not every unsaved or unstaged change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Think of the workflow as three separate checkpoints: the working files show what you have edited, the staged selection defines what the next commit will contain, and the commit records that selection in local history. Afterward, decide whether the commit should remain local or be pushed to a remote. This distinction helps prevent the common mistake of expecting a saved file or local commit to appear on a hosted service.

How do I clone or publish a repository?

Cloning brings an existing remote repository onto your computer. Publishing or pushing sends local work to a remote so it can be shared or backed up there.

Clone an existing repository

  1. Choose the Clone Repository button or open the Command Palette and run Git: Clone.
  2. Provide the repository location when prompted and choose where to place its local copy.
  3. Open the cloned folder in VS Code when the operation finishes.

Cloning sets up a local copy associated with the remote repository. Authentication and access permissions still determine whether you can push changes back.

Publish a local repository or branch

If a local repository has no remote, Publish to GitHub can create a hosted repository, add it as a remote, and push local commits. If the remote already exists and you are working on a local branch that has not been published, Publish Branch uploads that branch and sets its upstream.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Publishing is not the same as making a local commit. Check that the destination and repository visibility are appropriate before publishing, especially when a project contains work that should not be shared.

These paths serve different starting points. Choose Clone when the repository already exists remotely and you want a local copy. Choose Publish to GitHub when you have a local repository without a remote and want to create a hosted GitHub repository. Choose Publish Branch when a remote already exists but your current local branch still needs to be uploaded and associated with its remote counterpart.

A remote is the hosted repository location your local repository can communicate with. A local commit remains on your computer until you push it. Likewise, cloning or fetching remote work does not by itself give your account permission to change the original project. If you are collaborating on a project you cannot write to, use a fork and propose your changes with a pull request.

What is the difference between fetch, pull, push, and sync?

Fetch downloads information about remote commits without merging them into your current branch. Pull integrates remote commits into the current branch, push uploads your outgoing local commits, and sync performs a pull followed by a push.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Action What it does Use it when
Fetch Downloads commits and remote-tracking information without merging into the current branch. You want to inspect incoming work before integrating it.
Pull Integrates remote commits into the current branch; it does not upload your local commits. You are ready to bring remote work into the branch you are on.
Push Uploads outgoing local commits to the remote; it does not pull first. You want to publish local commits and know the branch is ready to upload.
Sync Pulls from the upstream branch first, then pushes outgoing commits. You intend to both integrate incoming work and upload your outgoing commits.

Choose Fetch when you want to see what has arrived before changing your current branch. Use Sync only when you intend to do both parts of the operation; it is not merely another word for push.

The practical difference is whether an operation changes the current branch or sends your work outward. Fetch gives you remote information to inspect without integrating it. Pull integrates remote commits into the branch you have checked out. Push sends your outgoing local commits without first pulling. Sync combines the latter two directions by pulling first and then pushing, so use it only when both steps match your intention.

If you are unsure what has arrived, fetch first and inspect incoming work, including the Source Control Graph. That gives you a chance to understand the remote changes before integrating them. If a push, pull, or sync fails, do not keep repeating the action or force-push without understanding the error. Check Git Output, authentication, repository permission, remote and upstream configuration, and whether a conflict or incomplete operation needs attention.

How do I work with branches, stashes, and worktrees?

A branch gives you a separate line of development, a stash temporarily sets unfinished changes aside, and a worktree checks out another branch in a separate folder. These tools address different kinds of separation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Branches for separate development

Create or switch branches from the Status Bar or Command Palette. A branch is useful for keeping a feature or other change separate while you work; after it is ready, merge it into a target branch such as main or develop. Use Publish Branch if you need to send the local branch to an existing remote.

Choose a branch when you want a distinct line of development that can be committed and reviewed separately. Once the work is complete, merge the feature branch into the intended target branch. If that branch needs to be available on the remote, publish it; creating or switching to a local branch does not automatically upload it.

Stash for a temporary pause

Use a stash when you need to set aside unfinished changes temporarily without creating a commit. A stash is not a substitute for a finished, documented commit; it is a way to clear the current working changes while you handle something else.

Also popular on Amazon
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

The key distinction is purpose: a branch is for separate development, while a stash is a temporary holding place for work that is not ready to become a commit. Stashing does not turn unfinished work into a completed, documented change in project history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Worktrees for simultaneous checkouts

Use a worktree when you need multiple branches checked out in separate folders at the same time. Unlike switching branches in one folder, separate worktrees let you keep those folder checkouts available concurrently.

Use a worktree rather than repeatedly switching a single folder when the need is to keep more than one branch checked out simultaneously. In short: branch for an isolated line of committed development, stash to pause unfinished edits, and worktree for concurrent folder checkouts.

How do I resolve a merge conflict in VS Code?

A merge conflict appears when Git cannot combine changes automatically. Use VS Code’s conflict actions or 3-way merge editor to decide the intended result; do not accept a choice blindly or finish a merge without reviewing the resulting file.

  1. Open each conflicted file shown by Source Control.
  2. Inspect the conflicting changes in context using the conflict actions or 3-way merge editor.
  3. Choose the intended content or edit a combined result. The correct resolution may be one side, the other side, or a deliberate combination.
  4. Review the resolved file as a whole, including the surrounding code or text, to confirm the result makes sense.
  5. Complete the merge only when you understand and accept the result. If you do not understand the proposed resolution, cancel the operation rather than recording an uncertain merge.

A conflict is a request for a human decision about competing edits, not a signal that Git knows which version should win. The merged file is the result that matters, so review it before treating the operation as complete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Resolve conflicts file by file, and inspect each conflict rather than choosing the same side automatically everywhere. The 3-way merge editor helps you compare the competing changes and form the intended result, but it cannot make the project decision for you. After editing or choosing content, read the resolved file in context. Only finish the merge when you understand and accept the resulting content; if you do not, cancel instead of recording an uncertain resolution.

Do I need a GitHub extension to use Git in VS Code?

No extension is required for core GitHub repository operations such as cloning, fetching, pulling, or pushing. VS Code includes basic GitHub authentication and Git support; extensions add workflows beyond those core operations.

  • GitHub Pull Requests and Issues is for creating or reviewing pull requests and managing issues.
  • GitHub Repositories lets you browse and edit a repository without cloning it locally. Terminal, build, and debugging workflows need a different environment.

Signing in does not grant write access to every repository. If you cannot push to the original project, the documented collaboration pattern is to work in a fork and open a pull request.

Choose the tool based on the task. Built-in Git support handles core repository operations, while the GitHub Pull Requests and Issues extension provides pull-request and issue workflows. GitHub Repositories serves a different purpose: browsing and editing a repository without a local clone. That virtual workflow is not a substitute for an environment when you need terminal, build, or debugging workflows.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Authentication and authorization are also separate. Signing in tells the service which account you are using; it does not give that account write access to every repository. When you cannot push to the original project, the collaboration pattern is to work in a fork and open a pull request rather than repeatedly attempting a push.

How can I inspect history and review work?

Use the Source Control Graph to inspect commits, branches, and incoming or outgoing work. For a particular file, Timeline in the Explorer shows its history; Git blame identifies who last changed a line.

Also popular on Amazon
BENFEI USB C Hub 5-in-1 with 4K HDMI(Certified), 100W Power Delivery, 3 USB-A, Silicone Cable, Aluminum Case Compatible with MacBook Pro/Air, iPad Pro, iMac, iPhone 15 Pro/Pro Max, XPS, Thinkpad
  • Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
  • Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
  • 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
  • 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
  • Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.
  • Check the Source Control Graph when you need to understand how commits and branches relate or whether work is incoming or outgoing.
  • Open Timeline in the Explorer when you need to inspect the history of one file.
  • Use Git blame when investigating the last recorded change to a particular line.

These views help both before and after a change: review the current work before committing, or trace a line and its history when investigating an existing change.

Use the Graph for repository-level context: it shows commits and branches and helps you inspect incoming or outgoing work. Use Timeline when your question is about one file’s history, and Git blame when you need to identify who last changed a particular line. Those are complementary review tools: one helps with the shape of repository history, another follows a file, and another focuses on line-level history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should I check when a Git operation fails?

If push, pull, or sync fails, inspect the latest Git command and its error in the Git Output window before trying again. Repeating sync or force-pushing without identifying the cause can make the situation harder to understand.

  1. Open the Git Output window and read the most recent command and error message.
  2. Check whether you are authenticated and whether your account has permission to access the repository or push to the destination.
  3. Check the repository’s remote configuration and confirm that the branch has the expected upstream configuration.
  4. Look for an unresolved conflict or another incomplete operation before attempting another pull, push, or sync.
  5. Address the specific issue indicated by the output, then retry the intended operation.

For SSH authentication, VS Code uses the SSH configuration from the installed Git distribution. For Azure DevOps organizations that require multifactor authentication, the FAQ recommends Git Credential Manager.

Keep the troubleshooting steps in order: the Git Output window gives you the recent command and error, which is more useful than guessing. Then verify that you are authenticated, have access to the repository, are pointing at the intended remote, and have an upstream branch configured where needed. Finally, check for a conflict or other incomplete operation. These checks address common categories of failure without resorting to repeated sync attempts or force-pushing blindly.

Authentication details depend on the connection. For SSH, VS Code uses the SSH configuration from the installed Git distribution. For Azure DevOps organizations that require multifactor authentication, Git Credential Manager is recommended in the FAQ. When the error persists, use the output to identify the specific failed operation rather than assuming every push or sync error has the same cause.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently asked questions

Can I use VS Code Git when I am offline?

Yes. You can edit files and make local commits without contacting a remote. Fetching, pulling, pushing, and other remote collaboration actions require a connection to the remote and any needed authentication.

Why does VS Code say there is no upstream branch?

An upstream is the remote branch associated with your local branch for operations such as sync. A newly created local branch may not have one until you publish it or otherwise associate it with a remote branch.

Publish Branch uploads a local branch to an existing remote and sets its upstream. Without an upstream, the local branch has no associated remote branch for operations such as sync to use.

Can I use Git commands in the terminal after using Source Control?

Yes. VS Code’s interface and the command-line Git use the same repository, so work performed through one is visible to the other. There is no separate VS Code copy of the repository to import or synchronize.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can I sign in to GitHub but still not push?

Authentication identifies your account; it does not grant write permission to every project. If you lack permission on the original repository, the collaboration route is to work in a fork and propose the change with a pull request.

Also popular on Amazon
𝟒𝐏𝐚𝐜𝐤 𝐔𝐩𝐠𝐫𝐚𝐝𝐞𝐝 USB to USB C Adapter,Type-C Female to A Male Charger Converter for iPhone 18 Charger,iWatch Ultra SE 9 10,iPhone 17 Pro Max 16 15 14,Samsung S25,AirPods,iPad,Car,Xbox
  • 【Read before You Buy】 Note: This adapter is USB 2.0 version and cannot transmit HDM, VGA, or other video signals. Nevertheless, they are fully capable of charging devices,duplicating files, and can be seamlessly integrated with USB-C earphones, wireless network adapters, and SD card adapters.
  • 【Easy to Use and Safe】Thanks to modern manufacturing techniques, we've made these adapters sufficiently compact so that they can remain inserted in your device without noticeable protrusion or inconvenience. This means you don't have to constantly plug and unplug them, reducing the likelihood of wear and misalignment, and making them more convenient to carry around.
  • 【Reliable Quality】Engineered for enhanced durability, durable aluminum alloy shell material,get excellent wear resistance and heat dissipation,the male USB C and female USB connectors & the male USB and female USB C connectors are designed to be plugged and unplugged up to 20000 times. Provides data transfer, device charging, memory space expansion, and additional computer peripherals.
  • 【Think more for you】Do you need to connect a USB-C-enabled device to an odd device that only has USB-A ports? Then these USB-A male to USB-C female adapters are made for you.Simply insert the adapter into the USB-A port on the device, and you can instantly connect your USB-C device to the device that originally didn't have the correct connection port.
  • 【Trusted xiwxi Quality and Service】As a responsible brand seller, you will receive xiwxi's 12-month Quality assurance and lifetime friendly customer service, you're not just buying a product,you're investing in peace of mind with all-round quality and exceptional customer service.

Do I need GitHub Pull Requests and Issues to clone or push?

No. Basic GitHub authentication and core Git operations such as cloning, fetching, pulling, and pushing are built into VS Code. The GitHub Pull Requests and Issues extension is for creating or reviewing pull requests and managing issues.

What is the difference between a branch, a stash, and a worktree?

A branch is a separate line of development, a stash temporarily sets unfinished changes aside without committing them, and a worktree keeps another branch checked out in a separate folder at the same time. Use the one that matches whether you need isolated development, a temporary pause, or simultaneous checkouts.

What should I do before retrying a failed sync?

Open Git Output and inspect the latest command and error. Check authentication, repository permissions, remote and upstream configuration, and any conflict or incomplete operation. Do not keep repeating sync or force-pushing without identifying the cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I authenticate to an Azure DevOps organization that requires multifactor authentication?

For Azure DevOps organizations requiring multifactor authentication, the FAQ recommends Git Credential Manager. For SSH authentication, VS Code uses the SSH configuration from the installed Git distribution.

Frequently Asked Questions

Can I use VS Code Git when I am offline?

Yes. You can edit files and make local commits without contacting a remote. Fetching, pulling, pushing, and other remote collaboration actions require a connection to the remote and any needed authentication.

Why does VS Code say there is no upstream branch?

An upstream is the remote branch associated with your local branch for operations such as sync. A newly created local branch may not have one until you publish it or otherwise associate it with a remote branch.

Can I use Git commands in the terminal after using Source Control?

Yes. VS Code’s interface and the command-line Git use the same repository, so work performed through one is visible to the other. There is no separate VS Code copy of the repository to import or synchronize.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can I sign in to GitHub but still not push?

Authentication identifies your account; it does not grant write permission to every project. If you lack permission on the original repository, the collaboration route is to work in a fork and propose the change with a pull request.

Do I need GitHub Pull Requests and Issues to clone or push?

No. Basic GitHub authentication and core Git operations such as cloning, fetching, pulling, and pushing are built into VS Code. The GitHub Pull Requests and Issues extension is for creating or reviewing pull requests and managing issues.

What is the difference between a branch, a stash, and a worktree?

A branch is a separate line of development, a stash temporarily sets unfinished changes aside without committing them, and a worktree keeps another branch checked out in a separate folder at the same time. Use the one that matches whether you need isolated development, a temporary pause, or simultaneous checkouts.

What should I do before retrying a failed sync?

Open Git Output and inspect the latest command and error. Check authentication, repository permissions, remote and upstream configuration, and any conflict or incomplete operation. Do not keep repeating sync or force-pushing without identifying the cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I authenticate to an Azure DevOps organization that requires multifactor authentication?

For Azure DevOps organizations requiring multifactor authentication, the FAQ recommends Git Credential Manager. For SSH authentication, VS Code uses the SSH configuration from the installed Git distribution.

The Bottom Line

Git in VS Code is easiest to use when you keep its steps distinct: save edits, review and stage the intended content, commit it locally, then push only when you want to upload it. Fetch, pull, push, and sync each have different effects, so inspect incoming work and resolve conflicts deliberately. The Source Control view provides the main workflow, while the terminal works on the same repository when you need it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply. Prices as of November 8, 2026 12:27 am GMT.