A Power Platform solution can be connected to a Git repo for tracking and management of changes to code. This is known as source control. To do this, a Git repo must be setup inside an Azure DevOps project. Then you can choose whether to connect individual solutions or the entire environment to source control
Table Of Contents:
• Initialize A Git Repo In Azure DevOps
• Connect The Environment To A Git Repo
• Select A Solution To Connect To Git
• Connect Another Solution To Git
• Commit Code Changes To A Git Repository
• View The Unpacked Solution In Source Control
Initialize A Git Repo In Azure DevOps
Go to Azure DevOps and open a project where you want the repo to be located. Then go to the Repos page and Initialize a new main branch with a readme.

The main branch of the repo will appear with a readme file inside of it.

Connect The Environment To A Git Repo
We want to connect the development environment to our git repo. Go to the development environment and open the Solutions page. Select Connect to Git from the top-menu bar.

Fill-in the Connect to Git menu with the following values the press the Next button.
- Connection Type – Solution
- Organization – the Azure DevOps organization where your repo is located
- Project – the Azure DevOps project where your repo is located
- Repository – the name of the repository
- Root Git Folder – “src” (which means source)

Select A Solution To Connect To Git
On the next screen we must select a solution to connect to git and select a branch and folder. Use the following values and press the Connect button.
- Solution – YourSolutionName
- Branch – main
- Git folder – src/YourSolutionName

After a few moments the solution will become connected to Git.

And the solution folder will appear in the repo. The folder will only include a readme file until we commit changes made to the solution.

Connect Another Solution To Git
Our Dataverse Git integration was setup with the connection type Solution. This means we must connect individual solutions one-by-one. To connect another solution, open the solution and go to the source control page. Then press the Connect to Git button and go through the wizard steps once again.

Next Steps
Continue to the next steps in the Power Platform Pipelines & ALM Setup Guide.
Next: Commit Code Changes To A Git Repo >>
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps & Power Automate articles sent to your inbox each week for FREE
Questions?
If you have any questions about Setup Git Integration For A Power Platform Solution please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
Hello, this is great, but I think we should be able to have possibility to change the project on devops also. Example
SharePoint DEV (Power Platform environment for all solutions that connect to sharepoint)
with Solution “Project A” and Solution “Project B”
If we have
Project A (Azure Devops Project)
Project B (Azure Devops Project)
We cannot connect to the different projects.
Did you have any workaround for this?