Git and GitHub
Git and GitHub are universal requirements for all emLab coding projects. Git is a version control system that tracks changes to your code on your local computer, maintaining a complete history of every modification. When you use Git, a complete history of all the changes made to your code are stored in a folder alongside your project files, known as a repository (or “repo”). GitHub is the online platform where we host these repositories and collaborate with others using tools for code review and project management. In short: Git is the tool you use locally to track changes, while GitHub is where you store and share those repositories with your team.
Why Git and GitHub?
- Promotes transparency and reproducibility by preserving a complete, time-stamped history of changes and making it easy to recover earlier versions.
- Improves code quality by protecting a working version as new features are developed and refined.
- Enables collaboration by letting multiple contributors plan their approach and work in parallel with Issues, branches, pull requests, and structured code review.
- Speeds onboarding because new team members can quickly understand project history and current priorities.
- Supports open and reproducible science by making methods, analysis code, and revision history accessible to collaborators, reviewers, future researchers, and the public.
All emLab coding work must live in a repository under the emlab-ucsb GitHub organization. The sections below cover everything you need to know, from initial setup through advanced workflows.
- Getting set up – Joining the emLab GitHub organization, installing git, and authenticating with GitHub.
- Repository organization – How to structure a repository and write an effective README.
- Version control with commits – What commits are and how to write a good commit message.
- Using Issues – How to use GitHub Issues to track work, document decisions, and communicate within a project.
- Working with branches – What branches are and how to use them in practice.
- Pull Requests – How to open, review, and merge a pull request.
- Rulesets – Protecting the main branch and enabling automated review.
- Effective workflows – What git-based development looks like in practice, for solo and collaborative work.
- Public repositories for publications – How to prepare a repository for public release alongside a publication.
- GitHub Extensions in Positron and VS Code – Using GitHub’s integrations in Positron and VS Code to streamline your workflow.
- GitHub Copilot – An optional AI coding assistant available through GitHub.