DevOps & CI/CD · Module 02
Git & GitHub
Distributed version control with Git: the three file states, everyday commands, branches and pull requests on GitHub — the base of every CI/CD pipeline.
What you will learn
- Tell Local, Centralized and Distributed VCS apart; tell Git from GitHub
- Describe the modified, staged and committed states and the add → commit → push flow
- Use basic Git commands: clone, init, commit, diff, branch, push, pull
- Create a feature branch and open a pull request into main with the GitHub CLI
Lessons
- Version Control and Git
Version control records the history of changes so you can return to any version; Git is a distributed VCS — every clone holds the full history; GitHub is just a host for Git repos.
- The Three File States and the Git Workflow
Files move from the working directory → staging area → local repository and only then are pushed to a remote; these match the modified, staged and committed states. A commit is local until you push.
- Common Git Commands
Create and switch branches with git switch -c (or checkout -b), push new branches with push -u, update with pull --rebase, view history with log --oneline --graph, park work with stash and mark releases with tags.
- GitHub, Branches and Pull Requests
Work on a feature branch, push it to GitHub and open a pull request into main for review and CI; only the main pipeline releases.