Before you commit a change, you check each line that changed.
To see these lines, you usegit difflike this:
Figure 1 - The Parts of a Diff
This output is called a unified diff.
When you change a line, Git shows the old line as removed and the new line as added.In the lab, you asked an AI assistant to rename VLAN 10 in
vlans.yaml.
Rungit diffto see what it also changed.Answer the question below
Which VLAN number did the AI assistant add?
git diffonly shows the changes that are not staged yet.
To see the changes that are in the staging area, you usegit diff --staged:
Figure 2 - What Each Command Compares
In the lab, an AI assistant changed
vlans.yamlanddeploy.py. You need to:Stage
vlans.yaml.Check what you staged with
git diff --staged.Commit it.
Answer the question below
Enter the flag you obtained.
Each commit has an identifier.
git log --onelineshows it at the start of each line, with the newest commit at the top:netops@automation:~/automation/netauto$ git log --oneline 9404f3a (HEAD -> main, origin/main, origin/HEAD) Remove the old files 301b209 Fix VLAN 20 e7362d5 Add VLAN 30 a3931d8 Add VLAN 20 bd3b7d0 Initial commitTo see what changed between two commits, you give their identifiers to
git diff, the older one first:
Figure 3 - A Diff Between Two Commits
In the lab, the commit
Fix VLAN 20changed the name of VLAN 20.
Compare it with the commit before it,Add VLAN 30, to answer the question.Answer the question below
What was the name of VLAN 20 before the fix?