none
How to add a project to source control in VS 2019? RRS feed

  • Question

  • I thought I could add projects (not solutions) to source control with previous versions of VS, but I could be wrong.

    VS 2019 allows adding solutions to source control.  I cannot figure out how to add an individual project to source control. 


    Hong

    Wednesday, July 17, 2019 1:16 PM

Answers

  • Hi Hong,

    Sorry to reply you so late.

    The connection l used to Team Explorer is TFS. Because of this, we can add selected projects to source control. However,there seems to be no such feature for Git, only the Solution can be added.

    l suggest you can package your project and upload to TFS.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, July 24, 2019 5:40 AM

All replies

  • Hi Hong,

    Welcome to the MSDN forum.

    According to your description, I think you just want one of the projects to be used for collaborative development,right? If so, we recommend you can try another way as below:

      1. connect to the Team Explorer 

      2. right-click on your solution-> choose Add to Source Control  

       >>Note: this is just adding monitoring

      3. right-click on your chosen project->Source Control->Check In...

      

    So you can handle the project in "Include Changes" of pending Changes.

    

    If you have any doubt, please feel free to let us know.

    Best Regards,

    Perry

     


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com





    Thursday, July 18, 2019 9:37 AM
  • Thank you for trying to help, Perry.

    I do not see "Add to source control". I see the following instead:


    I get the following when I click it:

    

    Should to click OK to proceed?


    Hong

    Thursday, July 18, 2019 3:53 PM
  • Hi Hong,

    Thanks for your feedback.

    The message box is just a prompt message. When you click OK, you have to do it manually. The message is obvious that you have to move your outside projects into the solution. It should be in the same directory as the .git repository folder so that it can be crawled.

    "ConsoleApp13" folder is a project under the solution and you should move all projects here like this.

    >>Note: when you have done it, please remember to clean and then build the solution.

    l hope it could help you.

    Best Regards,

    Perry

     


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com




    Friday, July 19, 2019 3:08 AM
  • Thank you for the explanation.

    The project (a class library shared by many solutions) is not under the directory of the solution.  This is exactly the reason I want to add individual projects to source control (I have quite a few class libraries).


    Hong

    Friday, July 19, 2019 7:03 PM
  • Hi Hong,

    Thanks for your feedback.

    You just want to add a project not a solution into source control. So according to your description, l find another way to achieve this effect.Please follow these steps:

      1. connect to the Team Explorer

      2. click the project you want to choose and then click File->Source Control->Add Selected Projects          to Source Control

        

       So you will see the project into Source Control like the picture below:

     

    Any feedback will be expected.

    Best Regards,

    Perry



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, July 22, 2019 5:44 AM
  • Thanks for your persistent help, Perry.

    I think that I do not fully understand what you mean by "connect to the Team Explorer". 

    I checked Team Explorer to make sure that everything looks fine, then switched back to Solution Explorer, selected the project, and clicked File.  I do not see Source Control:


    Hong

    Monday, July 22, 2019 1:15 PM
  • Hi Hong,

    Sorry to reply you so late.

    The connection l used to Team Explorer is TFS. Because of this, we can add selected projects to source control. However,there seems to be no such feature for Git, only the Solution can be added.

    l suggest you can package your project and upload to TFS.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, July 24, 2019 5:40 AM