DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

plumbing commands and tools are not ones you will be
using on a regular basis and are not covered on the exam.


Cloning/Initiating Repositories


Git operates on a number of processes that enable it to
do its magic. The first of these processes involves
defining a local repository by using either git clone or
git init. The git clone command has the following
syntax:


Click here to view code image


git clone (url to repository) (directory to clone
to)

If there is an existing repository you are planning to start
working on, like one from GitHub that you like, you use
git clone. This command duplicates an existing Git
project from the URL provided into your current
directory with the name of the repository as the directory
name. You can also specify a different name with a
command-line option. Example 2-3 shows an example of
cloning a repository and listing the files in the newly
created local repository.


Example 2-3 Cloning a GitHub Repository

Click here to view code image


#git clone
https://github.com/CiscoDevNet/pyats-coding-
101.git
Cloning into 'pyats-coding-101'...
remote: Enumerating objects: 71, done.
remote: Total 71 (delta 0), reused 0 (delta 0),
pack-reused 71
Unpacking objects: 100% (71/71), done.
#cd pyats-coding-101
#pyats-coding-101 git:(master) ls
COPYRIGHT coding-102-parsers
LICENSE coding-103-
yaml
README.md coding-201-
advanced-parsers
Free download pdf