SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Software-Defined Networking:
Introduction to Git for Network Engineers
16 April 2015
Abstract
This is a hands-on demonstration of Git, a free distributed revision control system. Git was initially
designed and developed by Linus Torvalds for Linux kernel development. It has become the most widely
adopted version control system for software development, but can be used to manage the revisions of
any project. As networks become more programmable, NetOps will need a working knowledge of Git to
consume open source software and to implement revision control on network configuration files.
2 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Table of Contents
Abstract ..................................................................................................................................................1
Overview.................................................................................................................................................3
Objective.................................................................................................................................................3
Requirements..........................................................................................................................................3
Hardware and Software.......................................................................................................................3
Recommended Reading.......................................................................................................................3
Exercises .................................................................................................................................................4
Signup for Github account ...................................................................................................................4
Install Git.............................................................................................................................................4
Configure Global Parameters...............................................................................................................4
Create a Repository .............................................................................................................................5
Using the GitHub web interface .......................................................................................................5
Clone the repository on your local machine .....................................................................................7
Basic Commands .................................................................................................................................8
git status..........................................................................................................................................8
git remote........................................................................................................................................8
git log ..............................................................................................................................................8
git checkout.....................................................................................................................................9
git add ...........................................................................................................................................10
git commit.....................................................................................................................................10
.gitignore – Ignoring files ...............................................................................................................11
git push..........................................................................................................................................11
git pull ...........................................................................................................................................12
git fetch .........................................................................................................................................13
git diff............................................................................................................................................14
Add Updates to the Project................................................................................................................14
Branching ..........................................................................................................................................17
git merge.......................................................................................................................................19
Delete the branch..........................................................................................................................19
Push to github repository...............................................................................................................19
Undoing a Change .............................................................................................................................20
3 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
View using GUI on GitHub..............................................................................................................22
Cleanup.............................................................................................................................................22
Summary...........................................................................................................................................23
Overview
As networks evolve to ever larger number of routers and switches, the need to incorporate revision
control of the configuration files of these devices becomes a necessity for the network manager. This
demonstration provides a hands-on tutorial of using Git and GitHub to manage router configuration
files.
GitHub is a web-based Git repository hosting service, which offers free accounts for public repositories,
and for-fee accounts to house private repositories. GitHub Enterprise can be installed on a server within
the enterprise to manage software development and other projects. Git is a command-line tool, GitHub
provides a web-based GUI. This training will illustrate how both tools can be used together.
Additionally, GitHub has become a repository for network automation tools for both Cisco Application
Centric Infrastructure (ACI) and software packages targeted at the Nexus 9000 family of switches
running NX-OS and the NX-API feature.
Objective
The objective of this demonstration is to provide the following:
 Enable a hands-on experience using Git and GitHub
 Develop an understanding of the importance of the incorporating revision control for
network configuration files.
At the completion of this exercise, the user should have a basic understanding of Git and how to use it
for revision control of router configuration files.
Requirements
Hardware and Software
Any laptop or server can be used to complete these exercises. Git is available for Windows, OS X (Mac
OS X) and Linux.
Recommended Reading
Fortunately, there is a multitude of resources available on the Internet for someone learning Git. Listed
are those found useful in the development of this training module.
4 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
 GitHub For Beginners: Don't Get Scared, Get Started
http://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1
Please make special note to review the section on Git-Specific Commands
 Git Cheat Sheet and Simple Guide
http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf
http://rogerdudler.github.io/git-guide/
 Github Cheat Sheet
https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf
 Getting Git Right
https://www.atlassian.com/git/
 Pro Git book
http://git-scm.com/book/en/v2
After you have installed git, you can access the local help by issuing git help or review the online help at
http://git-scm.com/docs/git-help
Exercises
These lab exercises step the student through the most common lifecycle states of a Git controlled
project. It is intended as an introduction and it is highly recommended the student use them as a guide
for continued hands-on experimentation.
Signup for Github account
Sign-up here: http://www.github.com and choose the Free plan (default).
Install Git
You need the Git command line tool. This demo is run from a Linux machine, but you can install it on
Windows and Mac OS as well.
Download Git here: http://git-scm.com/downloads
Git can also be installed with the following:
$ sudo apt-get install git
Configure Global Parameters
Customize your environment. These global parameters are the basics, configure them in your home
directory. You only need do them once on each computer, and can change them as required.
Refer to http://git-scm.com/docs/git-config
$ git config --list
$ git config --global user.name "John K. Smith"
$ git config --global user.email john.smith@example.com
$ git config --global core.editor vim # Note esc + :q or esc + :q! to exit vim
5 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
$ git config --global color.ui true
Your changes are stored locally, you can view the config file changes by issuing
$ cat ~.gitconfig
[user]
name = Joel W. King
email = joel.king@wwt.com
[core]
editor = vim
There are configuration commands specific to a local repository, after you have created a local repo, you
can view repo specific variables by issuing:
$ cat ~/<reponame>/.git/config
For more information see: http://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
Create a Repository
You can use Git to version control a project by creating a Git repositiory on your local machine, or you
can create the repository on a Git server (e.g. GitHub or Git enterprise) and use that to as the basis for
your local repository. This example walks you through using your own account on GitHub to get started.
Using the GitHub web interface
From your GitHub account, Create a new repository, you can use the repo name of ‘hello-world’ if you
wish. This is local to your account, so pick a name meaningful to you.
6 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
After you have created the repository, using the web interface Edit the README.md file and add some
additional text to the file, edit the README.md file, enter some text, and then commit the changes.
You should see these changes on your home page, by default, git shows your README.md file. Select
the latest commit URL and view the changes to the file.
The changes to the file are indicated by a plus “+” sign and are highlighted in light green.
7 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Clone the repository on your local machine
Read the section in http://git-scm.com/book/en/v2/Getting-Started-Git-Basics titled The Three Stages.
When we finish this section, you will have a new directory (the Working Directory) in your filesystem
with a hidden directory with the name .git. This directory is your local Git repository, within it resides a
file that represents the staging area.
We use the Git clone command to copy the remote git repository we created to our local machine. The
clone command does several things, consider it a macro which:
 Creates a directory with the same name as the repository we created,
 Issues a git init, to initialize the local repository
 Issues a git remote command named ‘origin’ pointing to the URL specified in the clone
 Downloads all the content from the remote repository
 Issues a git checkout of the default branch.
Select the URL to clone:
kingjoe@X-SDN-Controller:~$ git clone https://github.com/joelwking/igne.git
Cloning into 'igne'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
kingjoe@X-SDN-Controller:~$ ls -salt igne
total 16
4 drwxr-xr-x 3 kingjoe kingjoe 4096 Apr 9 14:41 .
4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 9 14:41 .git
4 -rw-rw-r-- 1 kingjoe kingjoe 137 Apr 9 14:41 README.md
4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 9 14:41 ..
kingjoe@X-SDN-Controller:~$ cd igne
In the previous example, the directory ‘igne’ is your working directory, and the .git directory holds your
staging area, repository and other configuration files.
8 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Basic Commands
Issue these commands to view what has been done on our local machine.
git status
The git status command will be used frequently, it reports on the status of the repository, what files
have been created and modified, which branch you are on, etc.
Refer to http://git-scm.com/docs/git-status
$ git status
# On branch master
nothing to commit (working directory clean)
git remote
Think of git remote as a means of creating an alias for a URL, in this example, ‘orgin’ is the alias for the
remote repository we created earlier.
Refer to http://git-scm.com/docs/git-remote
$ git remote -v
origin https://github.com/joelwking/igne.git (fetch)
origin https://github.com/joelwking/igne.git (push)
git log
The git log command shows us a list of commits done for this project. Basically a running history of the
changes.
Refer to http://git-scm.com/docs/git-log
$ git log
commit ef8ce79b0955ad7b17119510175d9be10ed118e4
Author: Joel W. King <joel.king@wwt.com>
Date: Thu Apr 9 14:20:27 2015 -0400
Update README.md
commit 0bd09b83af8d4ce9b96ca4e26984ad16ed40d855
Author: Joel W. King <joel.king@wwt.com>
Date: Wed Apr 8 17:17:12 2015 -0400
Initial commit
As the number of changes grow, it is useful to display them on one line.
$ git log --oneline
ef8ce79 Update README.md
0bd09b8 Initial commit
9 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
git checkout
Using the git checkout command allows you to navigate to specific points of time in the project. We can
checkout a commit and view the state of the file at that time. Git is changing the files in the working
directory to match the version of the commit we specify.
Refer to http://git-scm.com/docs/git-checkout
$ git checkout 0bd09b8
Note: checking out '0bd09b8'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 0bd09b8... Initial commit
Look at the contents of the file we initially created.
$ cat README.md
# igne
Introduction to Git for Network Engineers
Use the checkout master command to get back to the current state of our project.
$ git checkout master
Previous HEAD position was 0bd09b8... Initial commit
Switched to branch 'master'
Now look at the contents of the README.md file, we are back to the current state.
kingjoe@X-SDN-Controller:~/igne$ cat README.md
# igne
Introduction to Git for Network Engineers
This overview uses git to manage version control of a cisco router configuration file.
kingjoe@X-SDN-Controller:~/igne$
Create a file in our local directory.
$ cat QoS.cfg
!
class-map match-all VOICE
match ip dscp ef
class-map match-any CALL-SETUP
match ip dscp af31
match ip dscp cs3
class-map match-any INTERNETWORK-CONTROL
match ip dscp cs6
!
policy-map BRANCH_WAN
description Sample Branch WAN QoS Policy
class VOICE
10 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
priority percent 33
class CALL-SETUP
bandwidth percent 2
class INTERNETWORK-CONTROL
bandwidth percent 5
class class-default
fair-queue
random-detect
policy-map SHAPER
class class-default
shape average 1000000
service-policy BRANCH_WAN
!
Look at the status of our project
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# QoS.cfg
nothing added to commit but untracked files present (use "git add" to track)
git add
The git add command adds a change in the working directory to the staging area. It tells Git that you
want to include updates to a particular file in the next commit. Use the status command after the add to
view what has been done.
Refer to http://git-scm.com/docs/git-add
$ git add QoS.cfg
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: QoS.cfg
#
git commit
The git commit command commits the staged snapshot to the project history.
Refer to http://git-scm.com/docs/git-commit
$ git commit -m "Version 1 of Branch WAN QoS configuration"
[master 6c1b574] Version 1 of Branch WAN QoS configuration
1 file changed, 25 insertions(+)
create mode 100644 QoS.cfg
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
11 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Use the git log command following the commit.
.gitignore – Ignoring files
Files which are working or temporary files which you don’t want to view in the status can be ignored.
$ touch workfile
kingjoe@X-SDN-Controller:~/igne$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# workfile
nothing added to commit but untracked files present (use "git add" to track)
Add entries to the .gitignore file to exclude tracking the status of these files.
$ echo "workfile" >>.gitignore
$ echo ".gitignore" >>.gitignore
Now check the status and verify that our workfile is no longer shown.
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
$ git log --oneline
6c1b574 Version 1 of Branch WAN QoS configuration
ef8ce79 Update README.md
0bd09b8 Initial commit
git push
Now that we have created a new file and use the commit command to sync it from the staging area to
the local repository, we can push this change to GitHub. To illustrate that the origin alias refers to the
GitHub URL, lets create another remote name.
$ git remote add igne https://github.com/joelwking/igne.git
View what we have created and see that the keyword ‘origin’ is only a convention, we can create and
alias to refer to the remote URL by any name we wish.
$ git remote -v
igne https://github.com/joelwking/igne.git (fetch)
igne https://github.com/joelwking/igne.git (push)
origin https://github.com/joelwking/igne.git (fetch)
origin https://github.com/joelwking/igne.git (push)
Now push the changes to GitHub. We are updating the remote references to this project to be
consistent with our local references.
12 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Refer to http://git-scm.com/docs/git-push
$ git push igne master
Username for 'https://github.com': joelwking
Password for 'https://joelwking@github.com': <password>
To https://github.com/joelwking/igne.git
ef8ce79..6c1b574 master -> master
View the file on GitHub and click on the commits to view the commits.
Compare the above to what we have in on the local machines.
$ git log --oneline
6c1b574 Version 1 of Branch WAN QoS configuration
ef8ce79 Update README.md
0bd09b8 Initial commit
git pull
The git pull command updates our local computer files to have the most up-to-date version of the
remote repository. You “pull” the changes down from GitHub with this command.
13 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Refer to http://git-scm.com/docs/git-pull
$ git pull https://github.com/joelwking/igne.git master
From https://github.com/joelwking/igne
* branch master -> FETCH_HEAD
Already up-to-date.
git fetch
The git fetch command imports commits from a remote repository into your local repository. The
resulting commits are stored as a remote branch instead of a local branch. By using fetch, you can
review changes before integrating them into your project.
Refer to http://git-scm.com/docs/git-fetch
To Illustrate, use GitHub to add a file to the master branch, select the plus sign and create a new file
Enter any filename and data you wish, save it in the master branch. In this example, I will create a file
named gdi.py and enter a few comment lines with a python print statement.
On the local machine, issue the fetch command. It will use the remote specified by the ‘origin’ alias.
$ git fetch
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/joelwking/igne
6817ff3..961d88c master -> origin/master
The file we created has been downloaded but is not in our working directory
$ ls
QoS.cfg README.md workfile
14 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
To view, we will checkout the origin/master branch
$ git checkout origin/master
Note: checking out 'origin/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 961d88c... Create gdi.py
git diff
The git diff command shows us the differences between two points in time.
Refer to http://git-scm.com/docs/git-diff
The output of the diff command shows the content of the file we created on GitHub.
$ git diff master origin/master
diff --git a/gdi.py b/gdi.py
new file mode 100644
index 0000000..47c48b1
--- /dev/null
+++ b/gdi.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+#
git merge
The merge command incorporates the changes made on the master branch from GitHub to our local
master branch.
$ git checkout master
$ git merge origin/master
Updating 6817ff3..961d88c
Fast-forward
gdi.py | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 gdi.py
There will be an additional example of the merge command later in this document.
Add Updates to the Project
In this section, we will incorporate a change to the QoS configuration file, add the changes to the staging
area (index), commit them to the local repository and push the changes to the remote GitHub account.
Make changes to the QoS.cfg file, add a line under the class-map for VOICE
$ vi QoS.cfg
kingjoe@X-SDN-Controller:~/igne$ head QoS.cfg
15 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
!
class-map match-all VOICE
match ip dscp ef
match ip dscp cs5
class-map match-any CALL-SETUP
match ip dscp af31
match ip dscp cs3
class-map match-any INTERNETWORK-CONTROL
match ip dscp cs6
Check the status.
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: QoS.cfg
#
no changes added to commit (use "git add" and/or "git commit -a")
Now add, commit and push the changes.
$ git add QoS.cfg
$ git commit -m "Added CS5 to VOICE"
$ git push origin master
Username for 'https://github.com': joelwking
Password for 'https://joelwking@github.com':
To https://github.com/joelwking/igne.git
Verify what we have done
$ git status
# On branch master
nothing to commit (working directory clean)
$ git log --oneline
d7aba07 Added CS5 to VOICE
961d88c Create gdi.py
6c1b574 Version 1 of Branch WAN QoS configuration
ef8ce79 Update README.md
0bd09b8 Initial commit
Looking at the file on GitHub, we can easily see the change made to the QoS.cfg file
16 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
The working directory structure doesn’t need to be flat, we can create subdirectories and manage them
as well. Create a directory called bin and add a file to it.
$ mkdir bin
$ vi ./bin/sample.py
$ cat ./bin/sample.py
#!/usr/bin/env python
#
#
#
print "Hello World"
#
$ python ./bin/sample.py
Hello World
Now, add, commit and push the changes to the remote repository.
$ git add ./bin/*.py
$ git commit -m "incorporating binary files"
[master c939fb6] incorporating binary files
1 file changed, 6 insertions(+)
create mode 100644 bin/sample.py
$ git log --oneline
c939fb6 incorporating binary files
d7aba07 Added CS5 to VOICE
961d88c Create gdi.py
6c1b574 Version 1 of Branch WAN QoS configuration
ef8ce79 Update README.md
0bd09b8 Initial commit
$ git push origin master
Username for 'https://github.com': joelwking
Password for 'https://joelwking@github.com':
To https://github.com/joelwking/igne.git
d7aba07..c939fb6 master -> master
17 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Branching
Branching allows us to create our own timeline of commits. For example, if we have been asked to
develop some IP SLA configurations for the routers, we can create a branch for this development and
keep track of changes within a branch for IP SLA.
Now we are going to include some IP SLA configuration statements, we will create a new branch. It only
creates it, doesn't actually do anything.
$ git branch ipsla
$ git branch
ipsla
* master
git checkout
One additional function of the git checkout command is to switch between branches. Remember that git
checkout updates our working directory to align with a point of time in our project.
$ git checkout ipsla
Switched to branch 'ipsla'
git branch
* ipsla
Master
Create a file which contains some IPSLA router configuration commands.
$ cat ipsla.cfg
!
ip sla 443
http get http://198.18.4.1:443 source-ip 198.19.3.1 cache disable
tos 184
threshold 2000
timeout 3000
ip sla schedule 443 life forever start-time now
!
Note that git status tells us what branch we are using currently.
$ git status
18 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
# On branch ipsla
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ipsla.cfg
nothing added to commit but untracked files present (use "git add" to track)
$ git add ipsla.cfg
$ git commit -m "Baseline IPSLA configuration"
[ipsla 77ee968] Baseline IPSLA configuration
1 file changed, 8 insertions(+)
create mode 100644 ipsla.cfg
$ git branch
* ipsla
master
$ git log --oneline
77ee968 Baseline IPSLA configuration
c939fb6 incorporating binary files
d7aba07 Added CS5 to VOICE
961d88c Create gdi.py
6c1b574 Version 1 of Branch WAN QoS configuration
ef8ce79 Update README.md
0bd09b8 Initial commit
The directory contains the following files
$ ls -salt
total 36
4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 16 16:45 .git
4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:44 .
4 -rw-rw-r-- 1 kingjoe kingjoe 170 Apr 16 16:44 ipsla.cfg
4 drwxrwxr-x 2 kingjoe kingjoe 4096 Apr 16 16:39 bin
4 -rw-rw-r-- 1 kingjoe kingjoe 532 Apr 16 16:35 QoS.cfg
4 -rw-rw-r-- 1 kingjoe kingjoe 43 Apr 16 16:32 gdi.py
4 -rw-rw-r-- 1 kingjoe kingjoe 20 Apr 16 16:06 .gitignore
0 -rw-rw-r-- 1 kingjoe kingjoe 0 Apr 16 16:05 workfile
4 -rw-rw-r-- 1 kingjoe kingjoe 50 Apr 16 16:04 README.md
4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:02 ..
Now switch to the master branch, notice we do not see the ipsla.cfg file we created. Git has modified
our working directory to the current state of the mater branch.
$ git checkout master
Switched to branch 'master'
$ ls -salt
total 32
4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:46 .
4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 16 16:46 .git
4 drwxrwxr-x 2 kingjoe kingjoe 4096 Apr 16 16:39 bin
4 -rw-rw-r-- 1 kingjoe kingjoe 532 Apr 16 16:35 QoS.cfg
4 -rw-rw-r-- 1 kingjoe kingjoe 43 Apr 16 16:32 gdi.py
4 -rw-rw-r-- 1 kingjoe kingjoe 20 Apr 16 16:06 .gitignore
0 -rw-rw-r-- 1 kingjoe kingjoe 0 Apr 16 16:05 workfile
4 -rw-rw-r-- 1 kingjoe kingjoe 50 Apr 16 16:04 README.md
4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:02 ..
19 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
git merge
When we have finished working on a branch, and are satisfied with the changes, we can merge the
branch into the master branch so other people can see what we have added and changed.
Refer to http://git-scm.com/docs/git-merge
$ git checkout master
Switched to branch 'master'
$ git merge ipsla
Updating c939fb6..77ee968
Fast-forward
ipsla.cfg | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 ipsla.cfg
Once the changes have been merged, we can delete the branch.
Delete the branch
$ git branch -d ipsla
Deleted branch ipsla (was 77ee968).
Push to github repository
Now that the master branch is updated, we can push to the remote repository.
$ git push origin master
Username for 'https://github.com': joelwking
Password for 'https://joelwking@github.com':
To https://github.com/joelwking/igne.git
c939fb6..77ee968 master -> master
$ git status
# On branch master
nothing to commit (working directory clean)
20 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Undoing a Change
Assume we want to investigate what has changed between two points (commits) in our project, to
understand the before and after QoS configuration to change the VOICE class.
d7aba07 Added CS5 to VOICE
6c1b574 Version 1 of Branch WAN QoS configuration
NOTE: Your hash values will differ from what is shown in this example! Substitute your values rather than
using the examples shown in the exercise below.
We can use the checkout command to take a look at the file before and after the change and use an
editor to look at the files,
$ git checkout d7aba07
$ git checkout 6c1b574
Alternately, I can use git to diff the changes made between the two commits
git diff
The git diff command shows us the differences between two points in time.
Refer to http://git-scm.com/docs/git-diff
$ git diff d7aba07 6c1b574
diff --git a/QoS.cfg b/QoS.cfg
index 780ced5..ae608c8 100644
--- a/QoS.cfg
+++ b/QoS.cfg
21 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
@@ -1,7 +1,6 @@
!
class-map match-all VOICE
match ip dscp ef
- match ip dscp cs5
class-map match-any CALL-SETUP
match ip dscp af31
match ip dscp cs3
Then I can go back to the master branch and make a change to the file, commenting out the
configuration line.
$ more QoS.cfg
!
class-map match-all VOICE
match ip dscp ef
! match ip dscp cs5
class-map match-any CALL-SETUP
match ip dscp af31
match ip dscp cs3
class-map match-any INTERNETWORK-CONTROL
match ip dscp cs6
!
policy-map BRANCH_WAN
description Sample Branch WAN QoS Policy
class VOICE
priority percent 33
class CALL-SETUP
bandwidth percent 2
class INTERNETWORK-CONTROL
bandwidth percent 5
class class-default
fair-queue
random-detect
policy-map SHAPER
class class-default
shape average 1000000
service-policy BRANCH_WAN
!
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: QoS.cfg
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git add QoS.cfg
$ git commit -m "commented out match ip dscp cs5"
[master 91d9202] commented out match ip dscp cs5
1 file changed, 1 insertion(+), 1 deletion(-)
$ git push origin master
Username for 'https://github.com': joelwking
Password for 'https://joelwking@github.com':
To https://github.com/joelwking/igne.git
77ee968..91d9202 master -> master
Select the commits box on GitHub.
22 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
View the various commits to see the changes made to the QoS.cfg file.
View using GUI on GitHub
Cleanup
When we have finished this exercise, you can remove both the local repository and the remote
repository.
To delete all contents of the local directory on the Linux host
$ cd ~
$ rm -rf igne
On your GitHub account: go to Settings
23 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only
Then scroll down to the bottom and Delete the repository.
Summary
This demonstration provides the network engineer with examples of how to use git to manage versions
of router configuration file templates. You do not need to be a programmer to use git. Any knowledge
worker who has a need to manage versions of files can benefit from learning and using git.

Más contenido relacionado

La actualidad más candente

Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 

La actualidad más candente (20)

Distributed tensorflow on kubernetes
Distributed tensorflow on kubernetesDistributed tensorflow on kubernetes
Distributed tensorflow on kubernetes
 
Building Cloud Virtual Topologies with Ravello and Ansible
Building Cloud Virtual Topologies with Ravello and AnsibleBuilding Cloud Virtual Topologies with Ravello and Ansible
Building Cloud Virtual Topologies with Ravello and Ansible
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
Delivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
 
The Rise of the Monorepo at NVIDIA 
The Rise of the Monorepo at NVIDIA The Rise of the Monorepo at NVIDIA 
The Rise of the Monorepo at NVIDIA 
 
Kubernetes in kubernetes 搭建高可用環境
Kubernetes in kubernetes 搭建高可用環境Kubernetes in kubernetes 搭建高可用環境
Kubernetes in kubernetes 搭建高可用環境
 
Webinar: High velocity deployment with google cloud and weave cloud
Webinar: High velocity deployment with google cloud and weave cloudWebinar: High velocity deployment with google cloud and weave cloud
Webinar: High velocity deployment with google cloud and weave cloud
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用
 
Demystifying container connectivity with kubernetes in docker
Demystifying container connectivity with kubernetes in dockerDemystifying container connectivity with kubernetes in docker
Demystifying container connectivity with kubernetes in docker
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
DCSF19 Kubernetes Security with OPA
DCSF19 Kubernetes Security with OPA DCSF19 Kubernetes Security with OPA
DCSF19 Kubernetes Security with OPA
 
Kubernetes in Higher Education
Kubernetes in Higher EducationKubernetes in Higher Education
Kubernetes in Higher Education
 
CI and CD with Spinnaker
CI and CD with SpinnakerCI and CD with Spinnaker
CI and CD with Spinnaker
 
OpenShift, Docker, Kubernetes: The next generation of PaaS
OpenShift, Docker, Kubernetes: The next generation of PaaSOpenShift, Docker, Kubernetes: The next generation of PaaS
OpenShift, Docker, Kubernetes: The next generation of PaaS
 
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
 
Building a universal search interface for the Cloud
Building a universal search interface for the CloudBuilding a universal search interface for the Cloud
Building a universal search interface for the Cloud
 
Clocker, Calico and Docker
Clocker, Calico and DockerClocker, Calico and Docker
Clocker, Calico and Docker
 

Similar a Introduction to Git for Network Engineers (Lab Guide)

Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
uzair
 
gitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdf
saraichiba2
 
DevOps - Interview Question.pdf
DevOps - Interview Question.pdfDevOps - Interview Question.pdf
DevOps - Interview Question.pdf
MinhTrnNht7
 

Similar a Introduction to Git for Network Engineers (Lab Guide) (20)

Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
 
Git Demo
Git DemoGit Demo
Git Demo
 
gitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdf
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Git
GitGit
Git
 
git presentation
git presentation git presentation
git presentation
 
DevOps #EMERSONEDUARDORODRIGUES EMERSON EDUARDO RODRIGUES
DevOps #EMERSONEDUARDORODRIGUES EMERSON EDUARDO RODRIGUESDevOps #EMERSONEDUARDORODRIGUES EMERSON EDUARDO RODRIGUES
DevOps #EMERSONEDUARDORODRIGUES EMERSON EDUARDO RODRIGUES
 
Git
GitGit
Git
 
Git version control
Git version controlGit version control
Git version control
 
Git introduction
Git introductionGit introduction
Git introduction
 
DevOps - Interview Question.pdf
DevOps - Interview Question.pdfDevOps - Interview Question.pdf
DevOps - Interview Question.pdf
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 

Más de Joel W. King

Más de Joel W. King (20)

DevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptxDevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptx
 
BRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptxBRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptx
 
Introduction to GraphQL using Nautobot and Arista cEOS
Introduction to GraphQL using Nautobot and Arista cEOSIntroduction to GraphQL using Nautobot and Arista cEOS
Introduction to GraphQL using Nautobot and Arista cEOS
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development Environments
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network Analysis
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.
 
Cisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design GuideCisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design Guide
 
Meraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk PhantomMeraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk Phantom
 
Business Ready Teleworker Design Guide
Business Ready Teleworker Design GuideBusiness Ready Teleworker Design Guide
Business Ready Teleworker Design Guide
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using Ansible
 
DevNet Study Group: Using a SDK
DevNet Study Group: Using a SDKDevNet Study Group: Using a SDK
DevNet Study Group: Using a SDK
 
Foray into Ansible Content Collections
Foray into Ansible Content CollectionsForay into Ansible Content Collections
Foray into Ansible Content Collections
 
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
 
Enabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with AnsibleEnabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with Ansible
 
Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...
 
Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Under the Hood
Under the HoodUnder the Hood
Under the Hood
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Introduction to Git for Network Engineers (Lab Guide)

  • 1. Software-Defined Networking: Introduction to Git for Network Engineers 16 April 2015 Abstract This is a hands-on demonstration of Git, a free distributed revision control system. Git was initially designed and developed by Linus Torvalds for Linux kernel development. It has become the most widely adopted version control system for software development, but can be used to manage the revisions of any project. As networks become more programmable, NetOps will need a working knowledge of Git to consume open source software and to implement revision control on network configuration files.
  • 2. 2 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Table of Contents Abstract ..................................................................................................................................................1 Overview.................................................................................................................................................3 Objective.................................................................................................................................................3 Requirements..........................................................................................................................................3 Hardware and Software.......................................................................................................................3 Recommended Reading.......................................................................................................................3 Exercises .................................................................................................................................................4 Signup for Github account ...................................................................................................................4 Install Git.............................................................................................................................................4 Configure Global Parameters...............................................................................................................4 Create a Repository .............................................................................................................................5 Using the GitHub web interface .......................................................................................................5 Clone the repository on your local machine .....................................................................................7 Basic Commands .................................................................................................................................8 git status..........................................................................................................................................8 git remote........................................................................................................................................8 git log ..............................................................................................................................................8 git checkout.....................................................................................................................................9 git add ...........................................................................................................................................10 git commit.....................................................................................................................................10 .gitignore – Ignoring files ...............................................................................................................11 git push..........................................................................................................................................11 git pull ...........................................................................................................................................12 git fetch .........................................................................................................................................13 git diff............................................................................................................................................14 Add Updates to the Project................................................................................................................14 Branching ..........................................................................................................................................17 git merge.......................................................................................................................................19 Delete the branch..........................................................................................................................19 Push to github repository...............................................................................................................19 Undoing a Change .............................................................................................................................20
  • 3. 3 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only View using GUI on GitHub..............................................................................................................22 Cleanup.............................................................................................................................................22 Summary...........................................................................................................................................23 Overview As networks evolve to ever larger number of routers and switches, the need to incorporate revision control of the configuration files of these devices becomes a necessity for the network manager. This demonstration provides a hands-on tutorial of using Git and GitHub to manage router configuration files. GitHub is a web-based Git repository hosting service, which offers free accounts for public repositories, and for-fee accounts to house private repositories. GitHub Enterprise can be installed on a server within the enterprise to manage software development and other projects. Git is a command-line tool, GitHub provides a web-based GUI. This training will illustrate how both tools can be used together. Additionally, GitHub has become a repository for network automation tools for both Cisco Application Centric Infrastructure (ACI) and software packages targeted at the Nexus 9000 family of switches running NX-OS and the NX-API feature. Objective The objective of this demonstration is to provide the following:  Enable a hands-on experience using Git and GitHub  Develop an understanding of the importance of the incorporating revision control for network configuration files. At the completion of this exercise, the user should have a basic understanding of Git and how to use it for revision control of router configuration files. Requirements Hardware and Software Any laptop or server can be used to complete these exercises. Git is available for Windows, OS X (Mac OS X) and Linux. Recommended Reading Fortunately, there is a multitude of resources available on the Internet for someone learning Git. Listed are those found useful in the development of this training module.
  • 4. 4 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only  GitHub For Beginners: Don't Get Scared, Get Started http://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1 Please make special note to review the section on Git-Specific Commands  Git Cheat Sheet and Simple Guide http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf http://rogerdudler.github.io/git-guide/  Github Cheat Sheet https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf  Getting Git Right https://www.atlassian.com/git/  Pro Git book http://git-scm.com/book/en/v2 After you have installed git, you can access the local help by issuing git help or review the online help at http://git-scm.com/docs/git-help Exercises These lab exercises step the student through the most common lifecycle states of a Git controlled project. It is intended as an introduction and it is highly recommended the student use them as a guide for continued hands-on experimentation. Signup for Github account Sign-up here: http://www.github.com and choose the Free plan (default). Install Git You need the Git command line tool. This demo is run from a Linux machine, but you can install it on Windows and Mac OS as well. Download Git here: http://git-scm.com/downloads Git can also be installed with the following: $ sudo apt-get install git Configure Global Parameters Customize your environment. These global parameters are the basics, configure them in your home directory. You only need do them once on each computer, and can change them as required. Refer to http://git-scm.com/docs/git-config $ git config --list $ git config --global user.name "John K. Smith" $ git config --global user.email john.smith@example.com $ git config --global core.editor vim # Note esc + :q or esc + :q! to exit vim
  • 5. 5 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only $ git config --global color.ui true Your changes are stored locally, you can view the config file changes by issuing $ cat ~.gitconfig [user] name = Joel W. King email = joel.king@wwt.com [core] editor = vim There are configuration commands specific to a local repository, after you have created a local repo, you can view repo specific variables by issuing: $ cat ~/<reponame>/.git/config For more information see: http://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup Create a Repository You can use Git to version control a project by creating a Git repositiory on your local machine, or you can create the repository on a Git server (e.g. GitHub or Git enterprise) and use that to as the basis for your local repository. This example walks you through using your own account on GitHub to get started. Using the GitHub web interface From your GitHub account, Create a new repository, you can use the repo name of ‘hello-world’ if you wish. This is local to your account, so pick a name meaningful to you.
  • 6. 6 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only After you have created the repository, using the web interface Edit the README.md file and add some additional text to the file, edit the README.md file, enter some text, and then commit the changes. You should see these changes on your home page, by default, git shows your README.md file. Select the latest commit URL and view the changes to the file. The changes to the file are indicated by a plus “+” sign and are highlighted in light green.
  • 7. 7 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Clone the repository on your local machine Read the section in http://git-scm.com/book/en/v2/Getting-Started-Git-Basics titled The Three Stages. When we finish this section, you will have a new directory (the Working Directory) in your filesystem with a hidden directory with the name .git. This directory is your local Git repository, within it resides a file that represents the staging area. We use the Git clone command to copy the remote git repository we created to our local machine. The clone command does several things, consider it a macro which:  Creates a directory with the same name as the repository we created,  Issues a git init, to initialize the local repository  Issues a git remote command named ‘origin’ pointing to the URL specified in the clone  Downloads all the content from the remote repository  Issues a git checkout of the default branch. Select the URL to clone: kingjoe@X-SDN-Controller:~$ git clone https://github.com/joelwking/igne.git Cloning into 'igne'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (3/3), done. remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (6/6), done. kingjoe@X-SDN-Controller:~$ ls -salt igne total 16 4 drwxr-xr-x 3 kingjoe kingjoe 4096 Apr 9 14:41 . 4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 9 14:41 .git 4 -rw-rw-r-- 1 kingjoe kingjoe 137 Apr 9 14:41 README.md 4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 9 14:41 .. kingjoe@X-SDN-Controller:~$ cd igne In the previous example, the directory ‘igne’ is your working directory, and the .git directory holds your staging area, repository and other configuration files.
  • 8. 8 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Basic Commands Issue these commands to view what has been done on our local machine. git status The git status command will be used frequently, it reports on the status of the repository, what files have been created and modified, which branch you are on, etc. Refer to http://git-scm.com/docs/git-status $ git status # On branch master nothing to commit (working directory clean) git remote Think of git remote as a means of creating an alias for a URL, in this example, ‘orgin’ is the alias for the remote repository we created earlier. Refer to http://git-scm.com/docs/git-remote $ git remote -v origin https://github.com/joelwking/igne.git (fetch) origin https://github.com/joelwking/igne.git (push) git log The git log command shows us a list of commits done for this project. Basically a running history of the changes. Refer to http://git-scm.com/docs/git-log $ git log commit ef8ce79b0955ad7b17119510175d9be10ed118e4 Author: Joel W. King <joel.king@wwt.com> Date: Thu Apr 9 14:20:27 2015 -0400 Update README.md commit 0bd09b83af8d4ce9b96ca4e26984ad16ed40d855 Author: Joel W. King <joel.king@wwt.com> Date: Wed Apr 8 17:17:12 2015 -0400 Initial commit As the number of changes grow, it is useful to display them on one line. $ git log --oneline ef8ce79 Update README.md 0bd09b8 Initial commit
  • 9. 9 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only git checkout Using the git checkout command allows you to navigate to specific points of time in the project. We can checkout a commit and view the state of the file at that time. Git is changing the files in the working directory to match the version of the commit we specify. Refer to http://git-scm.com/docs/git-checkout $ git checkout 0bd09b8 Note: checking out '0bd09b8'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 0bd09b8... Initial commit Look at the contents of the file we initially created. $ cat README.md # igne Introduction to Git for Network Engineers Use the checkout master command to get back to the current state of our project. $ git checkout master Previous HEAD position was 0bd09b8... Initial commit Switched to branch 'master' Now look at the contents of the README.md file, we are back to the current state. kingjoe@X-SDN-Controller:~/igne$ cat README.md # igne Introduction to Git for Network Engineers This overview uses git to manage version control of a cisco router configuration file. kingjoe@X-SDN-Controller:~/igne$ Create a file in our local directory. $ cat QoS.cfg ! class-map match-all VOICE match ip dscp ef class-map match-any CALL-SETUP match ip dscp af31 match ip dscp cs3 class-map match-any INTERNETWORK-CONTROL match ip dscp cs6 ! policy-map BRANCH_WAN description Sample Branch WAN QoS Policy class VOICE
  • 10. 10 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only priority percent 33 class CALL-SETUP bandwidth percent 2 class INTERNETWORK-CONTROL bandwidth percent 5 class class-default fair-queue random-detect policy-map SHAPER class class-default shape average 1000000 service-policy BRANCH_WAN ! Look at the status of our project $ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # QoS.cfg nothing added to commit but untracked files present (use "git add" to track) git add The git add command adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit. Use the status command after the add to view what has been done. Refer to http://git-scm.com/docs/git-add $ git add QoS.cfg $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: QoS.cfg # git commit The git commit command commits the staged snapshot to the project history. Refer to http://git-scm.com/docs/git-commit $ git commit -m "Version 1 of Branch WAN QoS configuration" [master 6c1b574] Version 1 of Branch WAN QoS configuration 1 file changed, 25 insertions(+) create mode 100644 QoS.cfg $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean)
  • 11. 11 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Use the git log command following the commit. .gitignore – Ignoring files Files which are working or temporary files which you don’t want to view in the status can be ignored. $ touch workfile kingjoe@X-SDN-Controller:~/igne$ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # workfile nothing added to commit but untracked files present (use "git add" to track) Add entries to the .gitignore file to exclude tracking the status of these files. $ echo "workfile" >>.gitignore $ echo ".gitignore" >>.gitignore Now check the status and verify that our workfile is no longer shown. $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) $ git log --oneline 6c1b574 Version 1 of Branch WAN QoS configuration ef8ce79 Update README.md 0bd09b8 Initial commit git push Now that we have created a new file and use the commit command to sync it from the staging area to the local repository, we can push this change to GitHub. To illustrate that the origin alias refers to the GitHub URL, lets create another remote name. $ git remote add igne https://github.com/joelwking/igne.git View what we have created and see that the keyword ‘origin’ is only a convention, we can create and alias to refer to the remote URL by any name we wish. $ git remote -v igne https://github.com/joelwking/igne.git (fetch) igne https://github.com/joelwking/igne.git (push) origin https://github.com/joelwking/igne.git (fetch) origin https://github.com/joelwking/igne.git (push) Now push the changes to GitHub. We are updating the remote references to this project to be consistent with our local references.
  • 12. 12 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Refer to http://git-scm.com/docs/git-push $ git push igne master Username for 'https://github.com': joelwking Password for 'https://joelwking@github.com': <password> To https://github.com/joelwking/igne.git ef8ce79..6c1b574 master -> master View the file on GitHub and click on the commits to view the commits. Compare the above to what we have in on the local machines. $ git log --oneline 6c1b574 Version 1 of Branch WAN QoS configuration ef8ce79 Update README.md 0bd09b8 Initial commit git pull The git pull command updates our local computer files to have the most up-to-date version of the remote repository. You “pull” the changes down from GitHub with this command.
  • 13. 13 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Refer to http://git-scm.com/docs/git-pull $ git pull https://github.com/joelwking/igne.git master From https://github.com/joelwking/igne * branch master -> FETCH_HEAD Already up-to-date. git fetch The git fetch command imports commits from a remote repository into your local repository. The resulting commits are stored as a remote branch instead of a local branch. By using fetch, you can review changes before integrating them into your project. Refer to http://git-scm.com/docs/git-fetch To Illustrate, use GitHub to add a file to the master branch, select the plus sign and create a new file Enter any filename and data you wish, save it in the master branch. In this example, I will create a file named gdi.py and enter a few comment lines with a python print statement. On the local machine, issue the fetch command. It will use the remote specified by the ‘origin’ alias. $ git fetch remote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From https://github.com/joelwking/igne 6817ff3..961d88c master -> origin/master The file we created has been downloaded but is not in our working directory $ ls QoS.cfg README.md workfile
  • 14. 14 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only To view, we will checkout the origin/master branch $ git checkout origin/master Note: checking out 'origin/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 961d88c... Create gdi.py git diff The git diff command shows us the differences between two points in time. Refer to http://git-scm.com/docs/git-diff The output of the diff command shows the content of the file we created on GitHub. $ git diff master origin/master diff --git a/gdi.py b/gdi.py new file mode 100644 index 0000000..47c48b1 --- /dev/null +++ b/gdi.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# git merge The merge command incorporates the changes made on the master branch from GitHub to our local master branch. $ git checkout master $ git merge origin/master Updating 6817ff3..961d88c Fast-forward gdi.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 gdi.py There will be an additional example of the merge command later in this document. Add Updates to the Project In this section, we will incorporate a change to the QoS configuration file, add the changes to the staging area (index), commit them to the local repository and push the changes to the remote GitHub account. Make changes to the QoS.cfg file, add a line under the class-map for VOICE $ vi QoS.cfg kingjoe@X-SDN-Controller:~/igne$ head QoS.cfg
  • 15. 15 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only ! class-map match-all VOICE match ip dscp ef match ip dscp cs5 class-map match-any CALL-SETUP match ip dscp af31 match ip dscp cs3 class-map match-any INTERNETWORK-CONTROL match ip dscp cs6 Check the status. $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: QoS.cfg # no changes added to commit (use "git add" and/or "git commit -a") Now add, commit and push the changes. $ git add QoS.cfg $ git commit -m "Added CS5 to VOICE" $ git push origin master Username for 'https://github.com': joelwking Password for 'https://joelwking@github.com': To https://github.com/joelwking/igne.git Verify what we have done $ git status # On branch master nothing to commit (working directory clean) $ git log --oneline d7aba07 Added CS5 to VOICE 961d88c Create gdi.py 6c1b574 Version 1 of Branch WAN QoS configuration ef8ce79 Update README.md 0bd09b8 Initial commit Looking at the file on GitHub, we can easily see the change made to the QoS.cfg file
  • 16. 16 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only The working directory structure doesn’t need to be flat, we can create subdirectories and manage them as well. Create a directory called bin and add a file to it. $ mkdir bin $ vi ./bin/sample.py $ cat ./bin/sample.py #!/usr/bin/env python # # # print "Hello World" # $ python ./bin/sample.py Hello World Now, add, commit and push the changes to the remote repository. $ git add ./bin/*.py $ git commit -m "incorporating binary files" [master c939fb6] incorporating binary files 1 file changed, 6 insertions(+) create mode 100644 bin/sample.py $ git log --oneline c939fb6 incorporating binary files d7aba07 Added CS5 to VOICE 961d88c Create gdi.py 6c1b574 Version 1 of Branch WAN QoS configuration ef8ce79 Update README.md 0bd09b8 Initial commit $ git push origin master Username for 'https://github.com': joelwking Password for 'https://joelwking@github.com': To https://github.com/joelwking/igne.git d7aba07..c939fb6 master -> master
  • 17. 17 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Branching Branching allows us to create our own timeline of commits. For example, if we have been asked to develop some IP SLA configurations for the routers, we can create a branch for this development and keep track of changes within a branch for IP SLA. Now we are going to include some IP SLA configuration statements, we will create a new branch. It only creates it, doesn't actually do anything. $ git branch ipsla $ git branch ipsla * master git checkout One additional function of the git checkout command is to switch between branches. Remember that git checkout updates our working directory to align with a point of time in our project. $ git checkout ipsla Switched to branch 'ipsla' git branch * ipsla Master Create a file which contains some IPSLA router configuration commands. $ cat ipsla.cfg ! ip sla 443 http get http://198.18.4.1:443 source-ip 198.19.3.1 cache disable tos 184 threshold 2000 timeout 3000 ip sla schedule 443 life forever start-time now ! Note that git status tells us what branch we are using currently. $ git status
  • 18. 18 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only # On branch ipsla # Untracked files: # (use "git add <file>..." to include in what will be committed) # # ipsla.cfg nothing added to commit but untracked files present (use "git add" to track) $ git add ipsla.cfg $ git commit -m "Baseline IPSLA configuration" [ipsla 77ee968] Baseline IPSLA configuration 1 file changed, 8 insertions(+) create mode 100644 ipsla.cfg $ git branch * ipsla master $ git log --oneline 77ee968 Baseline IPSLA configuration c939fb6 incorporating binary files d7aba07 Added CS5 to VOICE 961d88c Create gdi.py 6c1b574 Version 1 of Branch WAN QoS configuration ef8ce79 Update README.md 0bd09b8 Initial commit The directory contains the following files $ ls -salt total 36 4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 16 16:45 .git 4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:44 . 4 -rw-rw-r-- 1 kingjoe kingjoe 170 Apr 16 16:44 ipsla.cfg 4 drwxrwxr-x 2 kingjoe kingjoe 4096 Apr 16 16:39 bin 4 -rw-rw-r-- 1 kingjoe kingjoe 532 Apr 16 16:35 QoS.cfg 4 -rw-rw-r-- 1 kingjoe kingjoe 43 Apr 16 16:32 gdi.py 4 -rw-rw-r-- 1 kingjoe kingjoe 20 Apr 16 16:06 .gitignore 0 -rw-rw-r-- 1 kingjoe kingjoe 0 Apr 16 16:05 workfile 4 -rw-rw-r-- 1 kingjoe kingjoe 50 Apr 16 16:04 README.md 4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:02 .. Now switch to the master branch, notice we do not see the ipsla.cfg file we created. Git has modified our working directory to the current state of the mater branch. $ git checkout master Switched to branch 'master' $ ls -salt total 32 4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:46 . 4 drwxrwxr-x 8 kingjoe kingjoe 4096 Apr 16 16:46 .git 4 drwxrwxr-x 2 kingjoe kingjoe 4096 Apr 16 16:39 bin 4 -rw-rw-r-- 1 kingjoe kingjoe 532 Apr 16 16:35 QoS.cfg 4 -rw-rw-r-- 1 kingjoe kingjoe 43 Apr 16 16:32 gdi.py 4 -rw-rw-r-- 1 kingjoe kingjoe 20 Apr 16 16:06 .gitignore 0 -rw-rw-r-- 1 kingjoe kingjoe 0 Apr 16 16:05 workfile 4 -rw-rw-r-- 1 kingjoe kingjoe 50 Apr 16 16:04 README.md 4 drwxr-xr-x 4 kingjoe kingjoe 4096 Apr 16 16:02 ..
  • 19. 19 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only git merge When we have finished working on a branch, and are satisfied with the changes, we can merge the branch into the master branch so other people can see what we have added and changed. Refer to http://git-scm.com/docs/git-merge $ git checkout master Switched to branch 'master' $ git merge ipsla Updating c939fb6..77ee968 Fast-forward ipsla.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ipsla.cfg Once the changes have been merged, we can delete the branch. Delete the branch $ git branch -d ipsla Deleted branch ipsla (was 77ee968). Push to github repository Now that the master branch is updated, we can push to the remote repository. $ git push origin master Username for 'https://github.com': joelwking Password for 'https://joelwking@github.com': To https://github.com/joelwking/igne.git c939fb6..77ee968 master -> master $ git status # On branch master nothing to commit (working directory clean)
  • 20. 20 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Undoing a Change Assume we want to investigate what has changed between two points (commits) in our project, to understand the before and after QoS configuration to change the VOICE class. d7aba07 Added CS5 to VOICE 6c1b574 Version 1 of Branch WAN QoS configuration NOTE: Your hash values will differ from what is shown in this example! Substitute your values rather than using the examples shown in the exercise below. We can use the checkout command to take a look at the file before and after the change and use an editor to look at the files, $ git checkout d7aba07 $ git checkout 6c1b574 Alternately, I can use git to diff the changes made between the two commits git diff The git diff command shows us the differences between two points in time. Refer to http://git-scm.com/docs/git-diff $ git diff d7aba07 6c1b574 diff --git a/QoS.cfg b/QoS.cfg index 780ced5..ae608c8 100644 --- a/QoS.cfg +++ b/QoS.cfg
  • 21. 21 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only @@ -1,7 +1,6 @@ ! class-map match-all VOICE match ip dscp ef - match ip dscp cs5 class-map match-any CALL-SETUP match ip dscp af31 match ip dscp cs3 Then I can go back to the master branch and make a change to the file, commenting out the configuration line. $ more QoS.cfg ! class-map match-all VOICE match ip dscp ef ! match ip dscp cs5 class-map match-any CALL-SETUP match ip dscp af31 match ip dscp cs3 class-map match-any INTERNETWORK-CONTROL match ip dscp cs6 ! policy-map BRANCH_WAN description Sample Branch WAN QoS Policy class VOICE priority percent 33 class CALL-SETUP bandwidth percent 2 class INTERNETWORK-CONTROL bandwidth percent 5 class class-default fair-queue random-detect policy-map SHAPER class class-default shape average 1000000 service-policy BRANCH_WAN ! $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: QoS.cfg # no changes added to commit (use "git add" and/or "git commit -a") $ git add QoS.cfg $ git commit -m "commented out match ip dscp cs5" [master 91d9202] commented out match ip dscp cs5 1 file changed, 1 insertion(+), 1 deletion(-) $ git push origin master Username for 'https://github.com': joelwking Password for 'https://joelwking@github.com': To https://github.com/joelwking/igne.git 77ee968..91d9202 master -> master Select the commits box on GitHub.
  • 22. 22 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only View the various commits to see the changes made to the QoS.cfg file. View using GUI on GitHub Cleanup When we have finished this exercise, you can remove both the local repository and the remote repository. To delete all contents of the local directory on the Linux host $ cd ~ $ rm -rf igne On your GitHub account: go to Settings
  • 23. 23 Introduction to Git for Network Engineers World Wide Technology, Inc. Confidential – Internal Use Only Then scroll down to the bottom and Delete the repository. Summary This demonstration provides the network engineer with examples of how to use git to manage versions of router configuration file templates. You do not need to be a programmer to use git. Any knowledge worker who has a need to manage versions of files can benefit from learning and using git.