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

A (brief) introduction to git

A (brief) introduction to git

A brief introduction to git (in 40 minutes) which has been presented by me at Google Global Dart Hackathon Prague 2012 in Google ČR. More info about event at https://sites.google.com/a/gug.cz/www2/Home/akce-1/globaldarthackathon2012

Tomas Jukin

April 27, 2012
Tweet

More Decks by Tomas Jukin

Other Decks in Programming

Transcript

  1. A (brief) introduction to git (in 40 minutes) By Tomáš

    Jukin @Inza 1 GUG.cz @GUGcz GUG CVUT @cvutGUG Google Global Dart Hackathon Prague 2012 @GUGhackathon #darthack12
  2. 4 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction

    to git “...about a SCM tool...” Today Source Code Management
  3. 5 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction

    to git • We NEED to share code! • FTP sucks • Mail sucks • CVS is a history • SVN is limited Why?
  4. 8 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction

    to git • Distributed SCM • By geeks around Linux Kernel • The most powerful SCM out there
  5. 9 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction

    to git • Secure • Distributed • Powerful
  6. 10 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction

    to git • http://git-scm.com/ • http://book.git-scm.com/ • http://progit.org/book/
  7. Workflow 15 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Local Repo Remote Repo
  8. Workflow 16 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo
  9. Workflow 17 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add
  10. Workflow 18 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove
  11. Workflow 19 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit
  12. Workflow 20 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit push
  13. Workflow 21 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit push fetch
  14. Workflow 22 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit push fetch pull or rebase
  15. Workflow 23 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit push fetch pull or rebase checkout HEAD
  16. Workflow 24 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Working Copy Index (stage) Local Repo Remote Repo add remove commit push fetch pull or rebase checkout HEAD commit -a
  17. Workflow (in code) git clone [email protected]/foo.git foo_dir cd foo_dir git

    add -a git commit -m “Updated foo class” git push 26 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  18. Cheatsheet 28 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git git status git branch Git Overview git add -A changes git commit -m “<message>” git push git init git clone <url> [<directory>] git remote Status Setup git remote add origin <url> git branch --set-upstream master origin/master git push origin master Create git pull Workflow UP Workflow DOWN git checkout <branch_name> git checkout -b <new_branch_name> Branching git merge <source_branch_name> git branch -d <branch_name> git fetch git merge git rebase files working copy Local Remote Beginner Intermediate Advanced v1.0.0 Created by Tomáš Jukin } It will be available at your table...
  19. Installation • Windows • msysgit - http://goo.gl/YdToL • MacOS •

    brew install git • Linux • apt-get install git 29 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  20. GUI? • Windows • TortoiseGit - http://goo.gl/9Gfhn • SmartGit -

    http://goo.gl/P8QqD • MacOS • GitX (L) - http://goo.gl/AMiqc • Linux • Choose yours - http://goo.gl/TebDq 30 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  21. Next? 31 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief)

    introduction to git Git Flow “A final solution to branches, releases and versions”
  22. Next? • GitHub - http://github.com • semver - http://semver.org •

    git flow (about) - http://goo.gl/MAF6m • git flow (CLI tool) - http://goo.gl/IbOJr • Interactive Git Cheatsheet - http://goo.gl/8yMZY 32 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  23. GitHub • Git repository hosting • Social Coding • Huge

    Community • Free public repos 33 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  24. GitHub • Now supports Dart! • .dart files • syntax

    highlight 34 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  25. Questions? • Yes, I will be there tomorrow to help

    ;-) ... 35 @GUGhackathon #darthack12 Tomáš Jukin @Inza - A (brief) introduction to git
  26. Thanks for attention And happy coding! Tomáš Jukin @Inza 36

    Google Global Dart Hackathon Prague 2012 @GUGhackathon #darthack12 Download me! http://goo.gl/I4LX0