Can I Use Two VSCode Instances on Different VMs with the Same GitHub Repo?

0
8
Asked By TechieWizard87 On

I'm an infrastructure engineer who primarily works with PowerShell scripts and uses GitHub for storage. I have two VMs: one in our main datacenter and another at our disaster recovery site. In case of a disaster, I can quickly get the DR VM up to restore critical systems while our main site is offline.

Both VMs have VSCode installed and are connected to my GitHub account, along with a shared network drive. I want to know if I can clone my team's GitHub repository onto this network drive and connect both instances of VSCode to it. My goal is to create a branch that both instances can work on simultaneously, so any changes I make to scripts on one VM will instantly appear on the other, even if I haven't pushed those changes to GitHub yet. Is this feasible? What potential drawbacks should I consider?

3 Answers

Answered By CodeNinja72 On

You can definitely set this up! Using a network drive to share the repository between the two VMs is a solid idea. Just keep in mind that having both instances editing the same files simultaneously can lead to merge conflicts, so make sure to commit your changes frequently and keep your changes small.

ScripterGal99 -

Totally agree! Also, if things get messy, you might want to consider just using Git commands instead of relying solely on the VSCode interface.

PowerShellPro56 -

Yeah, it's better to keep changes isolated to avoid issues, but this could work in a pinch!

Answered By DevOpsHero44 On

If you're looking for real-time collaboration, check out the Live Share extension for VSCode. It allows multiple users to work on the same project concurrently without the need for constant pushing and pulling. Just make sure both of your VSCode instances have it installed!

Answered By EngineerBob34 On

It sounds like you’re looking for a way to keep both VMs in sync without worrying about pushing commits all the time. While it’s possible, remember that if both VSCode instances modify a file at the same time, it can get tricky. Frequent small commits are your best bet for avoiding headaches later on, and don’t forget to manage your branches wisely!

InfraTech12 -

I've been there! Planning your commits and keeping a clean branch structure can save you a lot of trouble.

LazyCoder10 -

Yeah, managing branches can be such a pain, but it's worth it to keep things organized.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.