3

Ref: How do I refresh branches (local/remote) in Visual Studio when using Git?

Warning: I'm a total noob, please be gentle.

Info:

  • I already tried searching, but I did not find anything that seems relevant.
  • Most of the answers basically want you to re-pull the entire repository, overwriting everything on the local. (I am "assuming" that a brand-new pull from a brand new install of VSCode will either duplicate or overwrite everything in my local repo., instead of verifying that everything is OK.)

Given:

  • An existing project repository on GitHub
  • A local copy of that repository on my Win-10 box.

Information:

  • I recently nuked-and-rebuilt my Win-10 box
  • I reinstalled everything I believe I need, both software and data, for my project.
  • Since I haven't done anything with this project, (and I am the sole maintainer), everything should be fine.
  • Since the rebuild I have not tried to connect the new install of Visual Studio Code to GitHub so, unless all of these things are automatically done when when I re-opened my project, there is, (AFAIK), no correspondence between my local project and the remote master branch since they have never tried to connect since the rebuild.

Question:

  • Is it possible to "force" some kind of non-destructive communication between my new installation of Visual Studio Code and GitHub to verify that credentials are correct, it can bind to the correct remote repository, and that things "work"?
  • Is it possible to "audit" the state of the local and remote repositories, report any differences, and if everything's OK, re-establish the correspondence between the remote and local repositories?

Many answers talk about "pulling" or "cloning" the repository. Maybe I am not understanding rightly, but I don't want to "pull" or "clone", (which if I understand correctly, are potentially destructive), I just want the two repositories to talk to each other and let me know what's happening.

Thanks!

Jim JR Harris
  • 413
  • 1
  • 6
  • 15
  • When you say you "nuked and rebuilt" you Windows box, what does that mean precisely? Does that entail wiping your local copy of the repo? And if so, where did you restore it from? – anothernode Oct 19 '20 at 16:11
  • Nuke = nuke back to the stone-age, as in an "enhanced security erase" via hdparm. Restore = Restore from a known good total bare metal backup. update, install missing software and then restore from the backup I made of my home folder. – Jim JR Harris Oct 19 '20 at 16:29

1 Answers1

2

First step was to expand the Visual Studio Code window large enough so I could see details!

  1. In the lower left-hand corner there is a "head-and-sholders" icon (Accounts) that had an alert dot asking me to login/authorize VSCode to access GitHub. Having done that, the console responded with a few messages followed by "Login Success!"

  2. Click on the "Source Control" icon, (it looks like three circles connected by lines).

  3. At the very top, just under the menu-bar is a command-type bar for source control. At the far right of that section are three dots, (...), click on them to open the "Views and More Actions" drop-down menu.

  4. Go down to the "Pull, Push" menu item and open the sub-menu. At the very top is the option "sync", click it.

A few things will happen and then everything will be quiet. At this point, (AFAIK), the correspondence between the two repositories, master and local, has been re-established and work can continue.

Please correct any mistakes I made. I tried this and it appeared to work.

Jim JR Harris
  • 413
  • 1
  • 6
  • 15