Correct way to create different versions of my software?

CJha 21 Reputation points
2020-09-03T09:49:02.147+00:00

Hi! I am new to Visual Studio and it might seem like a silly question, how do I control the version of my software? I am creating software in C++ and during the development process, I make incremental changes to my software and increment its version number. Currently, I copy all the .h and .cpp files that I need from my previous version to my new version, for example, I am creating a plotting software named 'SmoothPlot' and each time I want to change something in this software I create a new solution, so I have solutions named 'SmoothPlot_v01', 'SmoothPlot_v02', 'SmoothPlot_v03'... Each of these solutions contains only one project and I have to manually copy .h and .cpp files from the previous solution to the new solution. This process is ok for small software development but as the complexity of the software increases, this will become increasingly cumbersome.

Ideally, I would like to create one solution and have multiple projects in it that are incremental in nature, something like right-clicking the solution name then clicking something like "create new version" and Visual Studio creates a new project in the solution with the same name as previous but attaching something like "v2" or "v1.2" at the end. Is there any way I can do this or equivalent in Visual Studio?

For reference, I am using Visual Studio Community 2019.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,602 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
328 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
963 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 27,266 Reputation points Microsoft Vendor
    2020-09-04T08:22:14.453+00:00

    Hello cjha,

    You can consider using Git or TFVC for version control, and consider using GitHub or Azure DevOps for storing your projects.

    I suggest you try to use Git and GitHub(or use local Git Repositories) with Visual Studio. Before using Github, please launch VS 2019, go to Extensions > Manage Extensions > Online > search, download and install “GitHub Extension for Visual Studio” extension.

    If you want to use local Git Repo, you can refer to this document: Repos, and create a new repo > add an existed project to the repo.

    For example, Launch VS > File > New > Repository… or just create a new project > click the “Add to Source Control” button > click Git.

    22647-add-to-source-control.png

    Open Team Explorer Window(View > Team Explorer) and click “Manage Connections” button, and you will see your repository under “Local Git Repositories” > double click it then you can perform some modifications for your project.

    22610-manage-connections.png

    You can use Branches to create and save project history, please refer to this document: Branches and for your requirements, you can click “Branches” > New Branch to new branches named ‘SmoothPlot_v01’, ‘SmoothPlot_v02’, ‘SmoothPlot_v03’…

    22638-branches.png

    After that, change something that you want in each of them > save and click “Home” button > Changes > enter a message > Commit All, then click “Home” button > Branches and check your projects(branches).

    22637-changes.png

    If you want to store them in GitHub, you need to firstly create a new github account, and then perform same actions like above. After “Add to Source Control” you can click “Home” button and choose “Sync” > “Publish to GitHub” > Publish.

    22679-sync.png
    22701-publish-to-github.png

    Using Pull, Fetch and Push, to modify changes and synchronize with your projects in GitHub and Local Repo.

    22599-pull-push.png

    Sincerely,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. CJha 21 Reputation points
    2020-09-07T08:26:41.8+00:00

    Thank you so much @Tianyu Sun-MSFT , it is very helpful. I will try to set up Github and use it like this.