I'm very new to git, and have only used it for simple project commits etc. so I may have made mistakes!
I recently began using git on originally unversioned code. I am using git in Visual Studio 2017. If I remember right, Visual Studio created the repositories, I didn't make any of them manually.
I have 4 projects in the same solution in Visual Studio. I noticed recently that 1 specific project didn't notify me of uncommited changes (Visual Studio puts icons next to files), and it wont let me commit changes, but I am able to see commit history. Using Git GUI or Bash I can see unstaged changes etc. and commit them.
Looking in file explorer I can see there is a git repo in the solution root directory, and no git repo in the 3 project directories that are working. But in the project that isn't working correctly it has its own git repo. I'm not sure how this happened.
I assumed this was causing a conflict preventing visual studio from recognising my changes. I want to basically remove the "child" git repo in the project directory, and have the "parent" repo manage the whole solution.
I attempted to merge the two repos following this method (from Git GUI on Windows: merging conflicts):
cd path/to/project-b
git remote add project-a /path/to/project-a
git fetch project-a --tags
git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
git remote remove project-a
I can see in my commit history that the "child" repo's history appears to have been merged in, but changes are still not detected in the offending project.
I renamed the child git repo to see if that helped, but no change.
Is there a process I need to follow to allow me to merge the two repos, and have the solution level git repo manage all projects?
It would be preferred to retain the commit history of the child project if possible.