For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview of Git Integrations

Written for the Old UI

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.

Initial Branch Creation and Sync

When a Git repository is connected to an existing DevOps tenant, a branch is created, and an initial commit is pushed to Git that includes all commit messages in DevOps for that branch. The following is an example of an initial commit in GitHub.

DevOps Commit

The following is an example of a DevOps commit in GitHub.

DevOps Pull Request Merge

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 following is an example of a merge commit in 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.

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?