Modernizing Version control for D365FO - Step by Step

Today I found a very nicely written article from Hamza Abid. Which I would like to share in here for future references. 

https://www.confiz.com/blog/modernizing-version-control-for-d365-a-step-by-step-guide-to-git-configuration-migration/

I will quickly put the high-level text / guidance shared by Hamza in here as well. 

GIT Configuration: 

  1. Create new repository
  2. Select GIT as your repository type
  3. and select the check box "Add a README."
  4. Click "Clone" button to clone the repo locally
  5. You can Copy the HTTPS path given (or) Select Visual Studio from the IDE option
  6. Copy the clone URL of the repository
  7. In Visual Studio, click on the clone repository in the "Git Changes" tab
  8. Paste the clone URL in the repository location section
    {Path used: C:\Users\localadmin\Source\DemoRepo}
    9 and click on the Clone button
  9. Click on the "Git repository" button under the "Team Explorer" tab.
  10. Right click on the main branch and click on "New local branch"
  11. Enter the name of the local branch and click "Create"
  12. Create a new Model
  13. Copy the newly created model
    {Name used: CustomSuite}
  14. and paste the new model into the metadata folder of the local repos.
    {Path used: C:\Users\localadmin\Source\DemoRepo\FinanceOperationsCode\Metadata}
  15. Open the command prompt and write a make link command to make the link
    {Command used: mklink /d "C:\AOSServer\PackagesLocalDirectory\CustomSuite" "C:\users\localadmin\source\repos\DemoRepo\FinanceOperationsCode\Metadata\CustomSuite" }
    {Output: Symbolic link created for C:\AOSService\PackagesLocalDirectory\CustomSuite <<===>> C:\Users\localadmin\Source\repos\DemoRepo\FinanceOperationsCode\Metadata\CustomSuite }
  16. The link of the model has now been created successfully in AOSService
  17. Create a new project
  18. Commit newly created model and project to local branch - Click on the "GIT Changes" tab. Select local branch, add the model and project files in the staged changes section and commit the initial commit.
  19. Initial commit has been checked into the local branch
  20. To see the history of the local branch, select the local branch and view the "History tab"
  21. After committing an initial check-in, right click on the local branch and then click on Push. This action saves the commit as a local snapshot.
  22. To Create a Pull request for the initial commit, right click on the local branch and then click on "Create pull request". A pull request is used to merge the code from one branch (local) to another branch (server local)?
  23. Verify the artifacts that need to be added to a pull request
    {Merge into: / From: / Name ...}
  24. To view the pull request on Azure, select the "Pull Request" tab.
  25. After verifying the elements, click on Pull request and then Complete button to merge the initial commit from local branch to the main / default branch
  26. The dialogue box will open after clicking on the complete button. In this dialogue box, you can select...
    -- Complete associated work items after merging
    -- Delete DemoRepo (branch) after merging
    -- Customize merge commit message


Work with GIT

  1. Create a class and then go to Git changes.
  2. In the staged changes section, take the class, after giving the name of the commit - click on Commit Staged
  3. Right click on the local branch and click Push
  4. Right click on the server local branch, select Create pull request and then create the PR
  5. After creating PR, click Complete the pull request
  6. Click on Complete merge
  7. To verify the result, go to the main branch and find the elements of the recent pull request.


Migrate repositories from TFVC to GIT

  1. Create a new repository where you would like to store the code for migration
  2. Select GIT as your repository type and unmark the "Add a README" option for the migraton
  3. Click on the import button under the Import a repository
  4. Select the type TFVC and give the repository path with the branch ($/Repository/Branch).
  5. If you want to migrate history, mark the migrate history check box "Yes" and enter the history up to 180 days
  6. The migration procedure will begin after you click the import button
  7. It might take a while to finish, but then the outcome will be shown.
  8. Click on contents button to view the items in the moved repository.

Hope this helps.

Comments

Popular posts from this blog

D365FO - Copy of databases across environments

Extended Data Types in Microsoft Dynamic Ax & EDT array

Change Tracking in Data Entities and latest changes