Slide 1

Slide 1 text

Git Workflow 101

Slide 2

Slide 2 text

Create new branch • Creating an environment where you can try out new ideas, you're free to experiment and commit changes • Don't affect the master branch • Anything in the master (production) branch is always deployable • Use descriptive branch name, e.g. refactor- authentication, user-content-cache-key

Slide 3

Slide 3 text

Add commits • Transparent history that others can follow to understand what you've done and why • Clear commit message help explaining why a particular change was made • Separate unit of change • Allow roll back changes if a bug is found, or if you decide to head in a different direction

Slide 4

Slide 4 text

Open a Pull Request • Initiate discussion about your commits • You're ready for someone to review your work • Using @mention • Start code review and conversation about proposed changes before they're merged into the master branch

Slide 5

Slide 5 text

Discuss and review your code • Person or team reviewing your changes may have questions or comments • Designed to encourage and capture this type of conversation • Continue to push to your branch in light of discussion and feedback about your commits

Slide 6

Slide 6 text

Merge and deploy • After review and test, merge branch to master for deployment • When pull request is merged, the related issues are also closed

Slide 7

Slide 7 text

Fork A Repo • Propose changes to someone else's project • Use someone else's project as a starting point for your own idea

Slide 8

Slide 8 text

Syncing a fork / working branch • Merging vs Rebasing

Slide 9

Slide 9 text

Merge

Slide 10

Slide 10 text

Merge

Slide 11

Slide 11 text

Rebase

Slide 12

Slide 12 text

Interactive Rebasing

Slide 13

Slide 13 text

The Golden Rule of Rebasing • Never use it on public branches • Local Cleanup

Slide 14

Slide 14 text

Force-Pushing • Git will prevent you from doing so because it conflicts with the remote master branch • We need force pushing • Be very careful with this command!

Slide 15

Slide 15 text

Incorporating Upstream Changes Into a Feature

Slide 16

Slide 16 text

Atomic commit • Keep commit small and atomic • Revolves around one task or one fix • Code Reviews are Easier • Easier to Roll Back • Commit message, One line description with issue reference < 50 char • More detailed explanatory text, if necessary

Slide 17

Slide 17 text

refs • Github workflow: https://guides.github.com/introduction/ flow/index.html • Fork a repo: https://help.github.com/articles/fork-a-repo/ • Merge vs rebase: https://www.atlassian.com/git/tutorials/ merging-vs-rebasing/workflow-walkthrough • Oursky Dev’s Guide: https://oursky.quip.com/ u1GVA1zDkOnJ • Better commit message: https://robots.thoughtbot.com/5- useful-tips-for-a-better-commit-message