VScode in sync (i.e. automatically pulling) w/ all github repositories

Viewed 3458

How to have my VSCode reflecting company's GitHub repositories (i.e. production code is pulled in real-time from all repositories) at all times?

In other words, I just want to make sure that my VSCode reflects production code at all times, and my company has dozens of repositores.

1 Answers

VSCode is only fetching (not pulling) the repositories it detects in its workspace.

Meaning if you are just opening VSCode (no workspace), it would not fetch anything.

If you are opening VSCode with a repository folder (or multiple repository folders in one workspace), it would fetch each repository.

From there, you can see, for a given repository (depending on the current file you have opened), the branch, number of local commits ahead/behind compared to what is fetched. (as described in issue 52339):

https://user-images.githubusercontent.com/1330321/41634668-6c3f71b2-7477-11e8-8eb2-f9a08f520170.png

Depending on the branch currently checked-out, that would reflect "production" code.
It depends on how you manage "production" code: on master branch? On "release" branch.
Since VSCode is fetching all branches at regular interval, you would find your remote "production" branch (be it master or any other naming convention you are using) always up-to-date.


  1. Can I write a script or something for this to be done at regular intervals?

You don't have to. VSCode already fetches regularly any remote Git repository it detects (if you have one opened)

  1. And how can I pull 50 repositories from GitHub to VSCode at once?

You don't have to: as soon as you are opening any one of those 50 repositories, it will be automatically be refreshed (fetched), and you will see in the bottom left corner of VSCode if your local clone is up-to-date or not.
No need to do the same for the other 49 repos: as long as you are not working with them locally, you don't need to fetch from them.

Related