Linux Labs

Automation: Git and Ansible / Stage 1 of 6

The history of configuration changes

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 6 · summary · 2 min

Summary

  • The .git directory keeps the config history: a chain of commits with an author, a date and a message.
  • git status and git diff show what was changed since the last commit, and git restore <file> throws that edit away.
  • git log -p and git blame find who changed a line, when and in which commit.
  • git revert <hash> undoes one commit with a new commit: the history and later edits stay in place.
  • nginx at the start of the lesson fell over an uncommitted line without a semicolon: nginx -t showed where parsing stumbled, and git diff showed the edit itself.
Ubuntu 24.04
Loading…