Source Control Concepts
# Source Control Concepts
Application code, IaC deployment files, CaC configs — all of it changes constantly, and someone needs to know which version is the real one. Git is how that gets tracked.
Explain source control concepts. Expect the exam to test whether you can name a Git subcommand from its description, place a change correctly in the working directory → staging → local repo → remote repo flow, and recognize a use case, a code review type, or a GitHub Actions capability from a scenario.
What you'll cover
Click one off as you go.
- Explain why version control matters for code, IaC, and CaC files.
- Walk a change through the Git flow — working directory to remote repository.
- Explain branching, pull requests, code review, and GitHub Actions.
Source control & version management
Automation and configuration management run on files — the settings and provisioning details that Ansible, Docker, and other tools depend on. Managing those files carefully means borrowing a developer standard: Git. Files may live in a central repository, accessed, edited, and updated by many people at once, with a simple but robust set of commands tracking every change.
Version control matters most in collaborative environments — multiple developers touching the same code, some changes shipping new features, others fixing stability or security issues. Git tracks changes over time, maintains a central storage repository, checks code in and out, and merges changes to and from decentralized developer systems.
Git concepts & use cases
Git isn't just for developers. Four common cloud/sysadmin use cases:
Git repositories & commands
A Git repository is the storage area for a project's code versions and related files — on a single workstation, or centralized and cloned down to each developer's machine. Organizations can host their own on-premises repository or use a service like GitHub; a centralized repository isn't required.
Every Git task runs as a subcommand of git [options] {subcommand}. The ones marked ★ are the ones you'll actually reach for most.
| Command | Description |
|---|---|
| config | Set options for a repository, Git users, or other global settings. |
| init | Create a Git repository, or reinitialize an existing one. |
| clone | Create a working copy of an existing repository. |
| add | Add files to be tracked by the Git repository. |
| commit | Update the repository with your changes — a "snapshot" of the project. |
| status | Display the status of the repository. |
| branch | Manage branches — pointers to specific snapshots after committing. |
| merge | Integrate changes from one branch into a "main" branch. |
| rebase | Rewrite Git history for a cleaner, more linear merge history. |
| pull | Acquire and merge changes from other repositories/branches into the local copy. |
| push | Upload a local working copy to a remote repository. |
| checkout | Switch to a specific branch to work with. |
| tag | Label a point in the repository's history — often a release. |
| show | Display information on the current branch's status. |
Note for the exam: Git recently renamed a core concept — the "master" branch is now the "main" branch. merge integrates changes and keeps the real history; rebase does the same but rewrites history to look serial, even when work happened in parallel — for a cleaner, easier-to-review log.
Where a change actually lives
A change passes through four places before it's shared. Click a command to see what it does at that step.
Local Git repository, start to finish
Small teams often work from local repositories; cloud providers also host them, including AWS CodeCommit and Azure Repos. A typical first run looks like this:
Working from an existing remote repository instead? git clone /dev-project pulls a working copy down first. And always work with copies of tracked files, not the originals — it makes rolling back a mistake trivial.
Branching & collaboration
A branch is a pointer to a snapshot — a safe place to make changes without touching main until they're ready.
git log shows what's merged and what else happened on the repo — useful for troubleshooting an issue introduced into configuration files, scripts, or anything else Git tracks. git checkout switches your working directory between branches of the same project.
Pull requests & repository files
A pull request asks project maintainers to review suggested changes and merge them if approved — the standard way contributors propose work on a shared or open-source project. Sample projects and hosting live on GitHub, GitLab, Bitbucket, and Digital Ocean, among others.
git init.Code review
A quality-assurance practice: at least one developer who isn't the author reads and checks the code, to improve quality, catch errors before production, and suggest improvements. Sometimes called peer review — and mandatory in some industries.
Manual peer review is still standard, but AI-based review tools are now common — fast, consistent, and scalable, and able to reveal (and sometimes correct) errors, inefficiencies, and baseline deviations. The risk: leaning on AI too heavily, especially in code production, without a broader review strategy around it.
GitHub Actions
GitHub is more than an online repository — it's a hosting service with tools that simplify development. GitHub Actions automate development workflows inside the repository, triggered by external events, internal events, or a schedule.
GitHub Actions supports common operating systems and programming languages, so compatibility is rarely a concern.
Code management spans developer code, Infrastructure as Code deployment projects, and Configuration as Code tasks.
Code naturally evolves — so tracking and identifying the definitive current version is critical.
This lesson covers Git, one of the most common source control tools.