More than 1 git repo in same parent folder

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
DaveT1
Posts: 224
Joined: 07 Oct 2014, 11:23

More than 1 git repo in same parent folder

Post by DaveT1 » 21 Mar 2023, 02:26

I have a project where I’m planning to port a 3rd party AutoHotkey v1 script to AutoHotkey v2.

The v1 code needs comments and tracer routines adding (for me to work out what’s going on); and reformatting to be more intelligible (to me!); and I need to create a load of testing. So I want the v1 code to be under revision control.

The v2 code doesn’t exist yet, but as it gradually comes into being I’ll also want this under revision control but in a separate repo. Maybe I could do something clever and have the v1 and v2 versions in separate branches of a single repo, but that’s not me – I’m just not clever enough!!

I also want other folders with supporting materials, which probably don’t need to be under revision control.

In the graphic below, I’ve tried to outline in very simple terms what such a project might look like (note that I’m specifically talking about local repositories here, ie., repos on local disk and not on, say, GitHub):
Image1.png
Image1.png (87.88 KiB) Viewed 1400 times
So how to achieve this, and specifically how to achieve this in vscode? Fortunately it’s pretty easy:
  1. Use vscode | File | Open Folder… to open the folder ahk v1 scripts here. Then go to vscode’s Source Contol panel (as shown in image below) and initialise a repo.
    Image2.png
    Image2.png (36.85 KiB) Viewed 1400 times
    • Repeat this for the folder ahk v2 scripts here.
      (At this stage we should have the required folder and repo structure per the 1st graphic above.)
      • Then, to start working on the project, simply use vscode | File | Open Folder… to open the 'parent' folder Git Repos across 2+ folders.

      The image below shows what happens after I put some minor changes in both the AutoHotkey files (1 in each of the 2 separately source-controlled folders). Then the Source Control panel shows them as having been modified (note the blue counter showing "2" as source control has detected two files that have been changed) and ready to accept commit messages (1 to each of the separate repos) before subsequently committing:
      Image3.png
      Image3.png (137.39 KiB) Viewed 1400 times

      The image above also shows what happens if you access the Show Commit Graph (indicated by the red circles), and specifically shows here the commit graph for the repo in the folder ahk v1 scripts here. Clicking on the other Show Commit Graph button replaces the commit graph with the one for the folder ahk v2 scripts here.

      Obviously, as a vscode newbie, if I've got things wrong in the above or there is a better way to do it, then I'd be delighted to hear about it :D.

      DaveT1
      Posts: 224
      Joined: 07 Oct 2014, 11:23

      Re: More than 1 git repo in same parent folder

      Post by DaveT1 » 21 Mar 2023, 02:34

      ...ooppss, I seem to have posted this in the wrong subforum! I meant to have it in the vscode editor forum - could the mods kindly move it? Thanks.

      gregster
      Posts: 8992
      Joined: 30 Sep 2013, 06:48

      Re: More than 1 git repo in same parent folder

      Post by gregster » 21 Mar 2023, 02:39

      DaveT1 wrote:
      21 Mar 2023, 02:34
      ...ooppss, I seem to have posted this in the wrong subforum! I meant to have it in the vscode editor forum - could the mods kindly move it? Thanks.
      Sure, done!

      DaveT1
      Posts: 224
      Joined: 07 Oct 2014, 11:23

      Re: More than 1 git repo in same parent folder

      Post by DaveT1 » 21 Mar 2023, 15:52

      gregster wrote:
      21 Mar 2023, 02:39
      Sure, done!
      Many thanks :bravo: .

      Post Reply

      Return to “Visual Studio Code”