0

I created a ClassLibrary and created a local Git from the Git menu...

enter image description here

Then I created a WinForm project and added the ClassLibrary (add project)...

enter image description here

But now if I try to create a local Git for my WinForm project, then it is already using the ClassLibrary's local Git...

enter image description here

How can I tell Visual Studio 2022 that I want to create a new local Git for the WinForm project?

Thanks

UPDATE - folder structure:

enter image description here

ClassLibrary structure:

enter image description here

WinForm structure:

enter image description here

3
  • 1
    We can't tell what your folder structure looks like. It would be helpful to see that, including an indication of where the .git folder is (as that indicates the root of the git repo). Do you definitely need two different git repos at all? (Where possible, I try to keep everything that naturally fits within one solution in the same git repo. It makes it much easier to keep track of changes.)
    – Jon Skeet
    Commented Oct 29, 2024 at 10:19
  • @JonSkeet ... Thanks - I updated my post with the folder structure. In my real world projects, the ClassLibrary is a shared library in all my projects. And since the ClassLibrary is outside my projects, it is not includet in the Git changes.
    – MojoDK
    Commented Oct 29, 2024 at 10:39
  • 1
    What happens if you just run git init within the WinFormsApp1 directory (the one containing WinFormsApp1.sln)? I'm not familiar with the granularity of VS's git support, but I'd strongly recommend that you make sure you've at least got the git command line tool available, even if you only need it occasionally.
    – Jon Skeet
    Commented Oct 29, 2024 at 10:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.