git
should be provided on most Unix systems by default.
- If you are working with Windows, we recommend using the
git
plugin in VSCode. - If you are working with OSX, we recommend updating git via Homebrew
- If you are working with Linux, make sure to update git via the package manager on your distro (ex: apt on Ubuntu)
Make sure you have two-factor auth setup in Github. This is a requirement for working with any repository in Otrego.
We expect all developers, both external contributors and maintainers to
interact with Clamshell via a
fork-and-pull-request model.
So generally, developers will fork the Clamshell repository and then submit
pull requests to the primary otrego/clamshell
repository.
Assuming you have created a fork of Clamshell (see Getting Started with Git), then create the relevant directories & clone the repo:
git clone github.com/<USERNAME>/clamshell
Set the upsteams appropriately:
cd clamshell
git remote add upstream [email protected]:otrego/clamshell.git
Check everything's set up correctly:
git remote -v
Update your repository with latest upstream changes from otrego/clamshell
git pull upstream master
Update your remote repository on github with latest upstream changes
git push
The general flow looks lishould be:
- Do development on branches in your fork.
- Make pull requests to the main repo
otrego/clamshell
- Get your code reviewed by a team member.
- Once approved, submit the changes.
Specifically, here's a full example workflow:
-
Merge any upstream changes into master.
git checkout master git fetch upstream git merge upstream/master # update my fork's master branch. git push
-
Do feature development on a branch
git checkout -b somefeature # ... do some work git add -A . git commit -a git push origin somefeature
-
(Optional) If much time has passed, make sure your local master & feature branches are updated, running through 1. and then rebasing on top of that.
git checkout master git fetch upstream git merge upstream/master git push # Update feature branch git checkout somefeature git merge master git push
-
When your change is ready, use the Github UI to get code reviewed & merge the changes into the repository:
-
Perform pull request via Github UI from your repsitory + feature branch to Github.
-
Get code reviewed by team member in Github UI. If you are reviewing code, make sure to 'Approve' the change.
-
Sqaush into single commit via Github UI and merge into the repository (this should happen by default.).
-
- The Git Book. In particular, I find these
sections very helpful:
- Basic Branching & Merging
- Distributed Workflows. Specifically, we use an Integration-Manager workflow (Github) in Otrego repositories.
- Getting Started with Github