Danaley
Danaley

Reputation: 803

How to do a git fetch in vscode?

I do not see an option to do a git fetch inside vscode Source Control tab.

How can I check what origin remote codes am I pulling and merging into my local source codes?

Upvotes: 43

Views: 85253

Answers (4)

VonC
VonC

Reputation: 1325986

VSCode 1.67 (Apr. 2022) will make that command more visible with a new menu entry.
(located, as noted by Kilo in the comments, within the "..." menu in the Source Control area.)
See issue 137916 and PR 137940:

https://user-images.githubusercontent.com/1876302/143589889-7a68671e-b77e-44fe-990c-01f35e27d659.png

The command palette is no longer the only option to find this Git operation.

Upvotes: 4

Arijeet Bhakat
Arijeet Bhakat

Reputation: 99

One alternate way is :

Go to SOURCE CONTROL Tab -> go to REMOTES section and you will be presented with the remote origin and there you have a reload button which also runs git fetch command.

Upvotes: 1

Willem
Willem

Reputation: 787

In View -> Command Palette... you can find many other git commands, including Fetch.

Upvotes: 59

Tony Stevanovich
Tony Stevanovich

Reputation: 314

VScode has a setting "git.autofetch" that is enabled to be true by default. This means when you do a git pull from the ... menu, a fetch will be ran prior to the pull. If you set git.autofetch to false, there is no explicit command from the dropdown that will do a fetch for you. You would have to type it in manually.

Upvotes: 15

Related Questions