Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

Git Workflow

Ross F. Calimlim edited this page Aug 10, 2019 · 7 revisions

High-level overview:

  1. Pull all changes from master at the start of your coding session.
  2. Create feature branches (you can't push to master).
  3. Commit often
  4. Push your local feature branch to the remote org repo.

Sample workflow

# Make sure your branch is up to date with master! You might need to resolve
# merge conflicts.
git pull

# Update your local dependencies
npm run setup

# Create (or checkout) your feature/fix/bug branch
git checkout -b your-branch-name

# Add the files you want to commit. Try to commit every 10-15 lines of
# code you write.
git add foo.html bar.js baz.yaml

# Remember to include your co-author (see below)!
git commit -m "Add commit title here"

# Once you're satisfied with your work, push your branch to the remote.
git push origin your-branch-name

# Go to GitHub and initiate a Pull Request (PR) from your branch to master.

# If you no longer need this branch, you can delete it 
# locally (and/or remotely).
git branch -d your-branch-name

Co-authoring commits

If you're pair programming, make sure to credit all parties!

You can do this by including co-author messages in your commit messages.

Via git commit

Commit title


Co-authored-by: co-author-username <co-author-public-email>

Via git commit -m

git commit -m "Commit message
>
>
Co-authored-by: co-author-username <co-author-public-email>"
Clone this wiki locally