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

Git Branches

Git Branches

Introduction to git branches on a [CodeCatz](https://github.com/CodeCatz) meetup.

5a5fcbae333f071dc7a28f4958509db5?s=128

Miha Rekar

October 23, 2013
Tweet

Transcript

  1. GITBRANCHES Miha Rekar

  2. GITBRANCHES

  3. GITBRANCHES Git branches

  4. Git branches Problem •only using master branch •conflicts on master

    branch •Developing only one task at a time
  5. Git Branches Example 1. Do work on a web site

  6. Git Branches Example 1. Do work on a web site

    2. Create a branch for a new feature you’re working on
  7. Git Branches Example 1. Do work on a web site

    2. Create a branch for a new feature you’re working on 3. Do some work in that branch
  8. Git Branches Example 1. Do work on a web site

    2. Create a branch for a new feature you’re working on 3. Do some work in that branch CRITICAL ISSUE 4. Revert back to your production branch 5. Create a branch to add the hotfix 6. After it’s tested, merge the hotfix branch, and push to production 7. Switch back to your original feature and continue working
  9. Git Branches BasicBranchING git branch crazy-experiment git branch -d crazy-experiment

    git checkout <existing-branch>
 git checkout -b <new-branch>
  10. Git Branches BASICWorkflow git branch new-feature git checkout new-feature #

    Edit some files git add <file> git commit -m "Started work on a new feature" # Repeat git checkout master git merge <branch>
  11. • The project maintainer initializes the official repository Git Branches

    githubflow
  12. • The project maintainer initializes the official repository • Developers

    fork the official repository Git Branches githubflow
  13. • The project maintainer initializes the official repository • Developers

    fork the official repository • Developers clone their forked repositories Git Branches githubflow
  14. • The project maintainer initializes the official repository • Developers

    fork the official repository • Developers clone their forked repositories • Developers work on their features Git Branches githubflow
  15. • The project maintainer initializes the official repository • Developers

    fork the official repository • Developers clone their forked repositories • Developers work on their features • Developers publish their features Git Branches githubflow
  16. • The project maintainer initializes the official repository • Developers

    fork the official repository • Developers clone their forked repositories • Developers work on their features • Developers publish their features • The project maintainer integrates their features Git Branches githubflow
  17. • The project maintainer initializes the official repository • Developers

    fork the official repository • Developers clone their forked repositories • Developers work on their features • Developers publish their features • The project maintainer integrates their features • Developers synchronize with the official repository Git Branches githubflow
  18. ShipIT

  19. http://mr.si/ @mr_foto mrfoto info@mr.si Git Branches Hvala @