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

Git 201

Git 201

Branching Models basic, Merging & how Github's pull request work

Dimitris Tsironis

May 31, 2013
Tweet

More Decks by Dimitris Tsironis

Other Decks in Technology

Transcript

  1. Dimitris Tsironis Front-end Engineer at BugSense, JavaScript lover || hater,

    Open-source & (Coffee)Script addict, Technology afficcionado
  2. Introducing Branching have multiple versions of the same project work

    async & simultaneously safer & more clean way to do things very “cheap” branches
  3. creating a branch $ git branch <new-branch-name> # Creates a

    new branch $ git checkout <new-branch-name> # Switch to new branch $ git branch # Check your local branches
  4. creating a branch #2 # Creates a new branch and

    switches to it immediately $ git checkout -b <new-branch-name>
  5. Cool story, bro! But, how can we move our code

    to our main branch and continue with our lives?
  6. Merging Merge two branches Keep the chances you want to

    keep You’re in control It’s easier in Git than in other VCS
  7. merging a local branch $ git checkout <dest-branch> # Switch

    to destination $ git merge <branch-name> # Merge the specified branch $ git log # Check if everything is fine
  8. deleting a branch # Deletes branch, but keeps commits $

    git branch -d <branch-name> # Force deletes everything, both branch and its commits $ git branch -D <branch-name> # USE WISELY!!
  9. Branches on Github Nothing special here Push your branches on

    Github Has some awesome tools for branches
  10. Pull requests Promoting collaboration Encouraging open source contributions (fork) Discussing

    features & changes on the go Merge without hassle and delete the branch
  11. Pull requests: reloaded Discussion for almost everything Can be created

    before coding starts You have a timeline history of commits Forum-like functionality lots of integrations and extra tools
  12. Extra tig (apt-get install tig, brew install tig) Github Help

    Git basics presentation Git documentation