Upgrade to Pro — share decks privately, control downloads, hide ads and more …

git_workflow.pdf

 git_workflow.pdf

975ff6c8166f6f32889f004a904ffa39?s=128

Oursky Limited

June 23, 2015
Tweet

Transcript

  1. Git Workflow 101

  2. 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
  3. 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
  4. 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
  5. 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
  6. Merge and deploy • After review and test, merge branch

    to master for deployment • When pull request is merged, the related issues are also closed
  7. Fork A Repo • Propose changes to someone else's project

    • Use someone else's project as a starting point for your own idea
  8. Syncing a fork / working branch • Merging vs Rebasing

  9. Merge

  10. Merge

  11. Rebase

  12. Interactive Rebasing

  13. The Golden Rule of Rebasing • Never use it on

    public branches • Local Cleanup
  14. 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!
  15. Incorporating Upstream Changes Into a Feature

  16. 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
  17. 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