Prerequisites
Install Git
First, you'll need to install Git on your computer:
- Windows: Download from git-scm.com
- Mac: it's probably already installed
- Linux: you probably know what to do
Forking the Repository
Fork the Repository
Navigate to the SWECC Labs repository you want to contribute to and click the "Fork" button in the top right. For example, for your first contribution, you should fork the swecc-labs repository.

Cloning Your Fork
Clone the Repository
Copy your fork's URL and clone it to your local machine:

git clone https://github.com/your-username/repository-name.git
Add Upstream Remote
Link your fork to the original repository:
git remote add upstream https://github.com/swecc-uw/repository-name.git
Making Changes
Create a Branch
Create a new branch for your changes:
git checkout -b branch-name
Commit Your Changes
After making your changes, commit them:
git add .
git commit -m "Description of your changes"
git push origin branch-name
Creating a Pull Request
Open a Pull Request
Go to your fork on GitHub and click "Pull Request"

Git CLI Reference
Common Git Workflows
I want to... | Commands to use |
---|---|
Start working on a new feature |
git fetch upstream git checkout upstream/main git checkout -b feature-name |
Save my work in progress |
git add . git commit -m "WIP: description of changes" |
Update my fork with latest changes |
git fetch upstream git checkout main git merge upstream/main git push origin main |
Undo my last commit (but keep changes) | git reset HEAD~1 |
Discard all my uncommitted changes | git reset --hard HEAD |
Switch to a different branch without losing changes |
git stash git checkout other-branch git stash pop # to get changes back |
Fix conflicts with main branch |
git fetch upstream git merge upstream/main # Fix conflicts in editor git add . git commit -m "Merge main and resolve conflicts" |
See what changes I've made |
git status # files changed git diff # actual changes |
Push changes for PR |
git push origin branch-name # Then create PR on GitHub |
Help Improve This Guide
Contribute to Documentation
This guide is open source and we welcome improvements! If you find something unclear, spot a mistake, or have ideas for better explanations, please contribute. You can:
- Add missing information
- Clarify confusing sections
- Fix typos or errors
- Improve the layout or design
- Add more helpful tips
Just fork the repository, make your changes, and submit a pull request. It's a great way to make your first contribution!