C
C#2y ago
M B V R K

✅ How to make Visual Studio's solution folders commited to GIT

I'm creating a blank solution using Visual Studio 2022, then I created two folders in it, src and tests, but when I commited any change the src and tests doesn't commited to the Repository only the projects inside them get commited but not the folders itself. Please, do you have any idea about how to fix this issue ?
16 Replies
ero
ero2y ago
What? Can you show what you're talking about? If the projects are in those folders, then that's how they will be committed. The folder structure is preserved.
M B V R K
M B V R KOP2y ago
as you see here
M B V R K
M B V R KOP2y ago
M B V R K
M B V R KOP2y ago
I have the solution folders
ero
ero2y ago
yeah those are solution folders. they aren't physical folders you'll need physical folders
M B V R K
M B V R KOP2y ago
but when commited the changes in github the folders not commited
ero
ero2y ago
because they don't really exist
M B V R K
M B V R KOP2y ago
how do I can add them ?
ero
ero2y ago
do you know how to create a folder on your computer?
M B V R K
M B V R KOP2y ago
hahahah yeah
ero
ero2y ago
there you go
M B V R K
M B V R KOP2y ago
but when I created them physically I can't see them in VS
ero
ero2y ago
you can have both physical and solution folders
M B V R K
M B V R KOP2y ago
you mean that if I created a solution folder named src then when i created a physical folder called src too, it will be commited ?
ero
ero2y ago
sure, or the other way around
mkdir IContactsApp && cd IContactsApp
dotnet new sln
mkdir src && cd src
dotnet new console -n IContactsApp
dotnet new classlib -n IContactsApp.Domain
dotnet new classlib -n IContactsApp.Infrastructure
dotnet new classlib -n IContactsApp.Shared
dotnet new webapi -n IContactsApp.Web.Api
cd ..
dotnet sln add src/IContactsApp
dotnet sln add src/IContactsApp.Domain
dotnet sln add src/IContactsApp.Infrastructure
dotnet sln add src/IContactsApp.Shared
dotnet sln add src/IContactsApp.Web.Api
mkdir test && cd test
dotnet new nuint -n IContactsApp.Tests
cd ..
dotnet sln add test/IContactsApp.Tests
mkdir IContactsApp && cd IContactsApp
dotnet new sln
mkdir src && cd src
dotnet new console -n IContactsApp
dotnet new classlib -n IContactsApp.Domain
dotnet new classlib -n IContactsApp.Infrastructure
dotnet new classlib -n IContactsApp.Shared
dotnet new webapi -n IContactsApp.Web.Api
cd ..
dotnet sln add src/IContactsApp
dotnet sln add src/IContactsApp.Domain
dotnet sln add src/IContactsApp.Infrastructure
dotnet sln add src/IContactsApp.Shared
dotnet sln add src/IContactsApp.Web.Api
mkdir test && cd test
dotnet new nuint -n IContactsApp.Tests
cd ..
dotnet sln add test/IContactsApp.Tests
M B V R K
M B V R KOP2y ago
alright, it fixed, massive thanks mate I really appreciate <3
Want results from more Discord servers?
Add your server