I am building a full-stack project where:
Backend: ASP.NET Core Web API (created in Visual Studio 2022)
Frontend: Angular project (created separately in VS Code)
Git: I initialized Git from Visual Studio, so a
.gitfolder already exists in the Web API solution folder
Now I want to place my Angular project inside the same Git repository, so that both frontend and backend are tracked together.
My current structure:
MySolution/
API/ ← ASP.NET Core Web API (already in Git)
.git/ ← Created automatically by Visual Studio
Then I created Angular separately:
Angular/ ← New Angular app created in VS Code
But this Angular folder is outside the Git repo, and I'm not sure what the correct way is to attach it to the same repository without breaking anything.
What I want to achieve
A structure like this, all in one Git repo:
MySolution/
API/
Angular/
.git/
Both projects should be version-controlled together so I can commit and push them in one repository.
Question
How can I correctly add my existing Angular project into the same Git repository that Visual Studio already created for the ASP.NET Core Web API?
Should I:
- move the Angular folder inside the Git root
- re-initialize Git inside the Angular folder
- or use some Visual Studio Git option?
I want the safest approach without corrupting the existing repo or losing history.