Skip to content

Version Control (Git)

Git tracks changes to source code over time. Learn branches, commits, merges, and pull requests.

This page includes a visual Git workflow diagram and core commands.

How Git Commands Work

Source: ByteByteGo

Core commands

Bash
# initialize and first commit
git init
git add .
git commit -m "Initial commit"

# branch and merge
git checkout -b feature/awesome
# edit files
git commit -am "Add awesome feature"
git checkout main
git merge feature/awesome

Note

Prefer pull requests with reviews over direct pushes to main.