Hey everyone, I'm an infrastructure engineer and often work with PowerShell scripts stored on GitHub. I have two VMs—one in our main data center and another at our disaster recovery site for backup in case of emergencies. Both machines run VSCode and are linked to my GitHub account, plus I can access a mounted network share on both.
My question is: if I clone my team's GitHub repo to the network share, can I connect both VSCode instances to it? Is it possible to create a branch that both instances can edit simultaneously? I'd like any changes I make on one VM to show up on the other right away, especially if a disaster strikes and I need to have the latest scripts available without needing to push changes first. Is this feasible? What drawbacks should I be aware of?
3 Answers
That sounds like a bit of an overkill with VSCode for a server environment—consider using the command line with GIT instead. You could even set up a script that grabs the latest version when you start up. This setup can be way more efficient than two VMs managing the same files.
You should be good to go! Just a couple things to note: instead of using two VMs, you could just use one with the network drive. If that VM crashes, you can always start a new one and hook up to the drive. Also, make sure to commit often and keep your commits small. If you’re worried about losing work, it kind of defeats the purpose of having version control in the first place.
Actually, as an infrastructure engineer managing these VMs, I understand the need for both. We don't usually spin up a new VM at the DR site without ready access. It’s just a matter of convenience for immediate access to what I need. That said, I totally agree on the frequent commits; sometimes I just procrastinate pushing changes because it feels like a hassle.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically