web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Merge process from Dev to Main

(0) ShareShare
ReportReport
Posted on by 4,131

Hi,

We are using two branches (Dev & Main).

Every night, all the developers check-in codes into Dev (including WIP codes). Once one unit (in our case, one FDD) of development finishes, we plan to move the code from Dev to Main. 

I was wondering what the best practice to merge the changeset from Dev to Main. I plan to move all the changesets of the finished FDD from Dev to Main. Based on your experience, do you foresee any problems on this?

Thanks,

I have the same question (0)
  • Verified answer
    Satish Panwar Profile Picture
    14,671 Moderator on at
    RE: Merge process from Dev to Main

    Hi Yuji,

    See below from Standard documentation. I have provided link below as well as it include details about other branches as well.

    The Main branch [1] is for changes that meet a certain quality bar and are ready for testing by other people. This testing might include user acceptance tests, performance tests, integration tests, and sanity tests after hotfixes. Deployable packages for this branch must be created by a build environment. As a best practice, you should not generate X++ packages in a Tier 1 environment and then deploy those packages into an official test or production environment. Otherwise, uncommitted source changes could be included. The correct approach is always to deploy packages that were built on official build environments.

    https://docs.microsoft.com/en-us/dynamics365/retail/dev-itpro/new-environments-visual-studio-teams-branch-retail-projects#branches-build-definitions-and-environments

  • Verified answer
    Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: Merge process from Dev to Main

    The process we follow is , we have another developer machine called migration in between Dev and UAT. Once the developers finishes their work , the automated scripts pull that code in migration environment where functional user do their testing and marked the stories as ready for main and notify developers through comments on the story and developer merges that story in main.

    In this way we don't promote all the code in main but only tested by functionals. Merge to main is done twice a week.

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Merge process from Dev to Main

    Hi Yuji,

    You can create separate workspaces in your Dev machine for Main and Release branch , one is pointing to your packagesLocalDirectory folder(Dev workspace) and other two are pointing to Main and release folders. Once you do that In VS while merging code to Main branch select workspace you created/Pointing to main branch and then go to Medatadata folder and start merge.

    OR

    You can map all three in a single workspace pointing to respective folders and start merging from Dev to Main and Main to Release . Advantage of doing this is each time you don't have to switch workspace while doing merge .

    -

    First way just to keep it simple.

  • Yuji Profile Picture
    4,131 on at
    RE: Merge process from Dev to Main

    Thanks Blue, do you need a dedicated person to merge the codes, or each developer merge the codes respectively?

  • Suggested answer
    Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: Merge process from Dev to Main

    The reason why we included functional testing before we merge the changes to main is to  save the effort of generating deployable package / build  again if anything fails in main, if we directly merged finished stories or FDD to main.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: Merge process from Dev to Main

    Each developer can merger their code that's what we do.

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Merge process from Dev to Main

    Hi Yuji

    One thing to keep in mind while merging is to check prev. unmerged changes on the same objects. For example, you have class1 and you make first change as changeset1 and after this next change as changeset2. While merging changeset2 without changeset1 you likely get both changes merged anyway and it's best practice to verify merged content before promoting to another branch.

    For WIP tasks you can look into shelvesets to keep dev branch as much stable as you can.

    BR, Sergey

  • Yuji Profile Picture
    4,131 on at
    RE: Merge process from Dev to Main

    Is a general practice use Shelvesets? If use Shelvesets, can I still oversee the progress? And what I worry is to cause a lot of merging issues later on?

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Merge process from Dev to Main

    Hi Yuji,

    Shelvesets and branches are not the same concept.

    Branching is taking a code base and "splitting" it off, basically making a copy of it. Development teams can all work on their own branches and then all changes can then be merged back into an originating branch.

    Shelving allows developers to check code into the source control system into a "shelve". The code is not checked into the main branch.

    -

    As mentioned above, For WIP tasks you can look into shelvesets to keep dev branch as much stable as you can.

  • Yuji Profile Picture
    4,131 on at
    RE: Merge process from Dev to Main

    One more question, when I merge from Dev to Main, do I merge from the Branch level (Dev -> Main), or Metadata level (Dev/Metatdata -> Main/Metadata), how about the projects under Dev branch, do I need to merge those to Main branch as well?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 865 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans