Network automation lab 3 of 27

Git for network configurations: branch, merge, squash, cherry-pick and revert

Run a real team workflow on a repository of router configurations: clone, branch and commit a change, merge with a conflict, squash a branch, cherry-pick one fix, revert a bad commit, survive a rejected push, tag a baseline and deploy it to two routers.

Run this lab

It needs Lite: its 3 nodes are set to 3 vCPU and 2,048 MB in total. That fits the free demo too.

In your workspace: Shared, then Network Automation - CCNA and CCNP Automation guided labs, then 03 - Git for network configurations - branch merge squash cherry-pick and revert

Try it free for 30 minutesRun it on Lite from £3 a day

The free demo needs no card and no email. Every lab plan includes every guided lab.

Level
Beginner
Time
About 75 minutes
Nodes need
3 vCPU, 2,048 MB
Smallest plan
Lite

The scenario

Kestrel Freight keeps the intended configuration of each branch router in a Git repository, netconfigs: one file per router in configs/. Nobody edits a router by hand any more: changes go on a branch, get reviewed and merged to main, and only main is deployed. Today four things land at once: your NTP change, legal's new banner wording, a squashed syslog change, and one fix from a hotfix branch that also contains work in progress. A colleague also committed an SNMP community that must not reach production. Your job is to end the day with a clean main, tagged v1.0, pushed and deployed to r1 and r2.

ItemValue
Team remote repository/srv/git/netconfigs.git (a bare repository on the workstation, standing in for GitLab or GitHub)
Branches on the remotemain, feature/banner (Tom), feature/syslog (Priya), hotfix/acl (Sam)
Routersr1 10.10.20.11, r2 10.10.20.12 (IOS 15.9), login netops / NetOps-Lab1
Deploy tool~/lab/tools/deploy.py r1 r2 (run from your clone)
Colleague simulator~/lab/tools/colleague-push.sh

What you’ll practise

  • Clone a repository and read its history, branches and remote
  • Add, remove and commit changes, and read a unified diff
  • Merge branches, resolve a merge conflict and squash a branch into one commit
  • Use cherry-pick, revert, reset and checkout, and know which are safe on shared history
  • Push and pull with a remote, recover from a rejected push, tag a release and deploy it

The tasks

  1. Set up Git and clone the repository
  2. Make a change on a branch: add, remove, diff, commit
  3. Merge your branch, then merge a branch that conflicts
  4. Squash a branch into one commit
  5. Cherry-pick one commit, revert another
  6. Reset and checkout: rewriting your own unshared work
  7. Push, get rejected, pull, push again; tag the baseline
  8. Deploy main to the routers

The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.

Topology and devices

The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.

Topology of Git for network configurations - branch merge squash cherry-pick and revert3 nodes and 1 network, 3 links. Every link is listed as text below the diagram.devboxr1r2Mgmteth0Gi0/0Gi0/0
3 nodes and 1 network, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in Git for network configurations: branch, merge, squash, cherry-pick and revert, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
devboxEVE-NG GUI server (Docker)eve-gui-server:latest1 vCPU, 1,024 MB
r1Cisco IOSvvios-adventerprisek9-m.spa.159-3.m91 vCPU, 512 MB
r2Cisco IOSvvios-adventerprisek9-m.spa.159-3.m91 vCPU, 512 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder Network Automation - CCNA and CCNP Automation guided labs.

  3. Open 03 - Git for network configurations - branch merge squash cherry-pick and revert and start its nodes, then open Lab Tasks for the scenario and the steps.

The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.

More Network automation labs

All Network automation labs

CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.