azure-devopsversion-controlvisual-studio-2019

When I add a solution to source control in VS 2019 Azure Devops only the startup project gets added - how do I add the others?


I am working on a solution that has 14 projects (so far) in it. I added the solution to Azure Devops source control and can see that the solution and the startup project have the little locks in the solution explorer, also I can see the startup project files in the devops repo, but I can't see how to add the other projects. Obviously I messed up somewhere, since ideally the repo would contain a folder for the startup project rather than the files themselves, but I don't know how to "undo" the source control and reset my solution back to its original state.

Can someone tell me how to either fix the source control so that the master branch contains all of the projects in sub-folders (as per the visual studio folder structure) - i.e. how to move the startup project files in the devops repo to a sub-folder and how to add the other projects to their own sub-folders, or, failing that, how to undo the source control so that all of my solution files are back on my local hard disk?

Any advice will be appreciated.


Solution

  • You mentioned that you are using Git. So when you DO NOT have local changes which are not pushed to your Git server, that means everything is "synced".

    Make a backup of your folder, just copy & paste everything!

    You can just delete the .git folder. So you have no "link" to the git server anymore.

    You can the link the "folder" again to your git server, with something like:

    git remote add origin https://YOURNAME.visualstudio.com/YOURPROJECT.git
    

    Another option is to check your .gitignore file, maybe some of your projects are excluded.

    When you are working with Visual Studio, you can also create a new empty solution and add the projects one by one. Also be sure that there is NO Filter in Project Explorer in Visual Studio.

    You can also check your Git changes, with git log or git status from any terminal or command line tool.