Overview of Git Integrations
Written for the Old UI
This article was written for the old UI. The instructions are still usable, but the screenshots are outdated. In some cases, items referenced in the instructions have moved or changed. If you cannot find an item, see the Where Did It Go article.
Overview
The Git integration lets you connect your Git repository to DevOps, so Salesforce metadata managed in DevOps branches is automatically synced. This ensures that your branches and commits are tracked in your Git-based version control system. When a DevOps pull request is merged, a commit is created for the merged changes. The Git integration pushes this commit to the target branch in Git, but the pull request is not synced with Git.
Best Practices
Name DevOps branches using only letters, numbers, and these symbols:
_ / - .. Avoid spaces or special characters to ensure smooth Git synchronization.Monitor the Git Integration Activities for exceptions and resolve them quickly.
Use filters to audit specific branches, dates, or statuses.
Structure of Synced Repository
After DevOps completes a synchronization with a Push to Git job, the connected Git repository reflects the DevOps branch states. Each sync job creates a new commit for traceability. The table below explains how the integration handles each of the following items.
Branches
Each DevOps branch is created or updated as a branch of the same name in your Git repository.
Commits
DevOps pushes commits to the branch. The commits always have Devops sync. A branch is synced. as the header. The commit body includes the Hash, Message, and CreatedAt for all DevOps commits pushed to Git during this sync.
Pull Requests
When a DevOps pull request is merged, a commit is created for the merged changes. The Git integration pushes this commit to the target branch in Git, but the pull request is not synced with Git. The pushed commit includes the following in the commit details: Message: Merge branch.
The repository is formatted as a Salesforce DX Project, with the following:
Standard Folders
force-app/
config/
scripts/
Standard Files
sfdx-project.json
package.json
README.md
The screenshot below shows an example of a branch in a GitHub repository that is synced with DevOps.

DevOps Sync Commits
Each commit that DevOps pushes to Git has the following format:
Commit Header
Commit Body
The commit body can include multiple DevOps commits, and the following information is provided for each DevOps commit.
Hash
Hash code of the DevOps commit represented by this message.
Message
Message of the DevOps commit.
CreatedAt
The ISO 8601 timestamp when the commit was created in DevOps.
The following are example screenshots of DevOps-synced commits on GitHub.
Bundled Commits
In some situations, the Git integration bundles multiple commits into a single commit that is synced to Git. In Git, the commit message includes details for each bundled DevOps commit. For example, when a component is edited in DevOps, the resulting commit is not pushed to Git until another branch action triggers a push. The following is an example of a bundled commit.

Commit bundling can cause Git to be temporarily out of sync with DevOps. However, once DevOps pushes the bundled commits to Git, the systems will be back in sync. If you are unsure whether a commit has been pushed to Git, compare the DevOps branch commits with the Git branch commits.
Supported Git Hosts
DevOps can connect to the following hosts for Git repositories.
GitHub
GitLab
Azure
Bitbucket
Detailed instructions for connecting to GitHub are provided in the article below and can serve as a guide for connecting to the other hosts, as the process is similar.
Last updated
Was this helpful?


