Free tech learning for everyone, from basics to pro

Network AutomationNetworking SecurityIntermediate

GitOps for network teams: managing configuration changes through Git and pull requests

In short: GitOps applies software practices to network changes. Intended configuration or variables live in a Git repository. Engineers propose changes in branches and pull requests, colleagues review them, a pipeline lints and tests them, and merging triggers automated deployment and verification. Git provides a complete history and simple rollback by reverting a commit.

The idea

In many teams, changes are typed into devices, recorded loosely in a ticket and backed up afterwards. With GitOps, the Git repository holds the intended state. Devices are updated from the repository, never by hand, so the repository and network stay aligned.

A GitOps workflow for network changesBranchedit intendedconfigPullrequestpeer reviewPipelinelint, test,dry runMergeapprovedchangeDeployautomationpushesVerifypost checks
Figure 1. Git becomes the place where every change is proposed, reviewed, tested and recorded.

What goes in the repository

  • Variables per site and device (YAML), or data exported from a source of truth.
  • Templates (Jinja2) that turn variables into configuration.
  • Playbooks or scripts that deploy and verify.
  • Tests and pipeline definitions.
  • Never passwords or keys in plain text; use a secrets manager or encrypted values.

The workflow

  1. Create a branch: git switch -c add-vlan-120-branch-15.
  2. Edit variables, commit with a clear message, push and open a pull request.
  3. The pipeline runs: YAML lint, template rendering, configuration diff against current state, policy checks (for example no "permit any any"), and lab or dry-run tests.
  4. A colleague reviews the diff and pipeline results, and approves.
  5. Merge, usually in a change window; the pipeline deploys and runs post-change checks.

Drift and rollback

  • Drift detection: scheduled jobs compare running configuration with intended configuration and report differences caused by manual changes.
  • Rollback: revert the commit and let the pipeline deploy the previous state.

Starting gradually

  • Begin by storing configuration backups in Git to get history and diffs.
  • Next, manage one area (for example VLANs or ACLs) through templates and pull requests.
  • Add pipeline checks, then automated deployment.
  • Train the team in Git basics; keep the process simple.
  • Agree a break-glass process for emergencies, followed by updating the repository.

Real-world example: the review that saved a branch

An engineer opened a pull request to update an ACL on 40 branch routers. The pipeline's rendered diff showed the new ACL would remove a line allowing the payment terminals' traffic, because a variable name had a typo. The reviewer spotted it immediately in the diff. Previously, the change would have been pasted into each router during the night.

Practice

In GitOps, where does the intended network state live?
In a Git repository, as variables, templates and code.
How do you roll back a change in a GitOps workflow?
Revert the commit and let the pipeline deploy the previous state.
What is drift detection?
Comparing running configuration with intended configuration to find manual or unexpected changes.

Key takeaways

  • GitOps keeps intended network state in Git.
  • Changes go through branches, pull requests, reviews and pipelines.
  • Merging triggers deployment and verification; reverting rolls back.
  • Detect drift and adopt the approach in small steps.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: