0

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 .git folder 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.

New contributor
Suparna Dhara is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • If I'm reading this correctly, you can simply copy the entire Angular folder into your MySolution folder (so it will sit next to the API folder). This is the same as your first option: "move the Angular folder inside the Git root". Then you can add the entire thing in one or more new commits as needed. If you're worried about messing up your repo, you can also backup your existing .git folder first. Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.