Git and Collaborative Workflows
Version every pipeline, SQL model and config with Git, and work with branches, pull requests and code review like a professional team.
Beginner · about 5 hours · difficulty 2/5
Learn first: Linux and the Command Line for Data Work
Data code is code. Your SQL models, DAGs, Spark jobs and infrastructure configs all live in Git, go through pull requests and get deployed by CI. Teams that edit SQL directly in a warehouse UI lose history and break production.
Core skills
- The model: working directory, staging area, commits, branches, remotes.
- Daily commands:
git status,add,commit,log,diff,branch,switch,pull,push. - Branching: one short-lived feature branch per change, merged through a pull request.
- Merge conflicts: read the markers, decide, test, commit.
- Undo safely:
git restore,git revertfor shared history,git resetonly for local work.
Data-specific habits
- Never commit data files, credentials or
.envfiles. Use.gitignoreand a secrets manager. - Keep notebooks small or pair them with scripts; large notebook diffs are unreadable.
- Write commit messages that explain *why* a transformation changed ("exclude test merchants from GMV").
- Review SQL like code: check joins for fan-out, filters, and null handling.
CI basics
Most data teams run linting (sqlfluff, ruff), unit tests and dbt build on every pull request via GitHub Actions or similar. You will meet this again in the dbt and quality sections.
Pitfalls
- Committing a service account key. Rotate it immediately; deleting the commit is not enough once pushed.
- Long-lived branches that drift for weeks and become painful to merge.
You are ready to move on when you can create a branch, make a change, open a pull request, resolve a conflict with a teammate's change and merge it cleanly.
Key concepts
- Commits, branches, remotes
- Pull requests and code review
- Merge conflicts
- revert vs reset
- .gitignore and secrets hygiene
- Commit message conventions
- GitHub Actions basics
- Rebase and interactive history
Mini project
Create a GitHub repo for your data engineering learning. Add a README, a .gitignore for Python and data files, and your shell script from the Linux topic. Make two branches that edit the same file, merge both through pull requests and resolve the conflict.
Check yourself
You pushed a commit containing a database password to a public repo. List the steps you take, in order.
Free resources
- Pro Git (git-scm.com)
- Git and GitHub roadmap (roadmap.sh)
- GitHub Docs (GitHub)