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.
I will quickly put the high-level text / guidance shared by Hamza in here as well.
GIT Configuration:
- Create new repository
- Select GIT as your repository type
- and select the check box "Add a README."
- Click "Clone" button to clone the repo locally
- You can Copy the HTTPS path given (or) Select Visual Studio from the IDE option
- Copy the clone URL of the repository
- In Visual Studio, click on the clone repository in the "Git Changes" tab
- Paste the clone URL in the repository location section
{Path used: C:\Users\localadmin\Source\DemoRepo}
9 and click on the Clone button - Click on the "Git repository" button under the "Team Explorer" tab.
- Right click on the main branch and click on "New local branch"
- Enter the name of the local branch and click "Create"
- Create a new Model
- Copy the newly created model
{Name used: CustomSuite} - and paste the new model into the metadata folder of the local repos.
{Path used: C:\Users\localadmin\Source\DemoRepo\FinanceOperationsCode\Metadata} - 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 forC:\AOSService\PackagesLocalDirectory\CustomSuite <<===>> C:\Users\localadmin\Source\repos\DemoRepo\FinanceOperationsCode\Metadata\CustomSuite} - The link of the model has now been created successfully in AOSService
- Create a new project
- 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.
- Initial commit has been checked into the local branch
- To see the history of the local branch, select the local branch and view the "History tab"
- 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.
- 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)?
- Verify the artifacts that need to be added to a pull request
{Merge into: / From: / Name ...} - To view the pull request on Azure, select the "Pull Request" tab.
- 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
- 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
- Create a class and then go to Git changes.
- In the staged changes section, take the class, after giving the name of the commit - click on Commit Staged
- Right click on the local branch and click Push
- Right click on the server local branch, select Create pull request and then create the PR
- After creating PR, click Complete the pull request
- Click on Complete merge
- To verify the result, go to the main branch and find the elements of the recent pull request.
Migrate repositories from TFVC to GIT
- Create a new repository where you would like to store the code for migration
- Select GIT as your repository type and unmark the "Add a README" option for the migraton
- Click on the import button under the Import a repository
- Select the type TFVC and give the repository path with the branch ($/Repository/Branch).
- If you want to migrate history, mark the migrate history check box "Yes" and enter the history up to 180 days
- The migration procedure will begin after you click the import button
- It might take a while to finish, but then the outcome will be shown.
- Click on contents button to view the items in the moved repository.
Hope this helps.
Comments