Sub topic 9
Pulling and committing changes
This chapter assumes you know Git basics (branches, commits, merges) and have a work item linked to a development sandbox. You should also have a pipeline with at least one stage. Here you move changes from the sandbox into the work item's branch.
How the flow works
Each work item has its own feature branch in the repository. DevOps Center tracks what you change in the development environment. It then writes those changes to the branch as a commit. You never type Git commands for this.
Two actions matter:
- Pull Changes checks the development environment for changes that source tracking detected and lists them.
- Commit writes the changes you selected to the work item branch, with a message you provide.
Pulling changes
- Make your edit in the development sandbox, for example add a custom field to Account.
- Open the work item in DevOps Center and choose Pull Changes.
- Wait for the list of detected components to load.
The list shows each component and whether it was added, changed, or deleted. If your change is missing, check these causes:
- The metadata type is not supported by source tracking.
- You made the change in a different sandbox than the one linked to the work item.
- The change is already in the branch, so nothing new is detected.
Committing changes
- Select only the components that belong to this work item.
- Enter a commit message that names the work item and the reason for the change.
- Choose Commit.
DevOps Center commits to the work item branch. You can check the result in your Git provider:
git fetch origin
git log --oneline origin/main..origin/WI-000123The branch name above is an example. Use the name shown on your work item.
You can pull and commit many times. Small commits make review and conflict handling easier.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Pull Changes shows nothing | Change made in the wrong org, or type not tracked | Confirm the linked sandbox, then retry |
| Unrelated components listed | Other people share the sandbox | Commit only your components |
| Commit fails | Branch protection or lost repository authentication | Reconnect your Git account and check branch rules |
| Component missing in the branch | It was ignored by `.forceignore` | Review the ignore file |
Exercise
You added a field and edited an unrelated Apex class in the same sandbox. Both appear after Pull Changes. What should you commit for this work item?
Show answer
Commit only the field if it belongs to the work item. The Apex class should go in its own work item, or stay uncommitted. Committing it would send it through review and promotion with the field.