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

Git and Github for Startups - Workshop

Git and Github for Startups - Workshop

Git is a Distributed Version Control System (DVCS), is one of the most important tools for IT startups. Github is a tool that give you the power to manage your Git repositories, manage issues, milestones, do code review and much more things.

This workshop will focus the basics of Git and show how to use Github effectively and also provide a branch model to use in your own startup.

This workshop was given @ The Startup Scholarship 2013 edition

Daniel Gomes

July 15, 2013
Tweet

More Decks by Daniel Gomes

Other Decks in Technology

Transcript

  1. Git and Github
    for Startups
    Daniel Gomes @danielcsgomes
    July 13, 2013
    workshop

    View Slide

  2. • Full Stack Web Developer @ Sedimap PT
    • Father, Geek
    • Zend Certi!ed Engineer PHP 5.3
    • Certi!ed Scrum Master
    • @danielcsgomes
    About Me

    View Slide

  3. Agenda
    Git
    About Version Control
    Basics of Git
    A successful Git branching model
    Github
    About Github
    Using Github

    View Slide

  4. View Slide

  5. About Version Control

    View Slide

  6. What is Version Control?
    Version control is a system that records changes to
    a file or set of files over time so that you can
    recall specific versions later.

    View Slide

  7. Types of
    Version Control System
    Local Version Control System
    Centralized Version Control System (VCS)
    Distributed Version Control System (DVCS)

    View Slide

  8. Local
    Version Control System

    View Slide

  9. Centralized
    Version Control System

    View Slide

  10. Distributed
    Version Control System

    View Slide

  11. Basics of Git
    Installing Git
    First Git project
    Basic Commands

    View Slide

  12. Installing Git
    First Git project
    Basic Commands
    Download
    http:/
    /git-scm.com/downloads

    View Slide

  13. $ git config --global user.name "Your Name Here"
    $ git config --global user.email "Your Email Here"
    Add username and email to .gitconfig
    Installing Git
    First Git project
    Basic Commands

    View Slide

  14. Installing Git
    First Git project
    Basic Commands
    # First Git Project
    $ mkdir git_project
    $ cd git_project
    $ git init
    $ tree -a -L 2
    .
    └── .git
    ├── HEAD
    ├── branches
    ├── config
    ├── description
    ├── hooks
    ├── info
    ├── objects
    └── refs

    View Slide

  15. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  16. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git init
    Create an empty git repository
    or reinitialize an existing one
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  17. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git add
    Add file contents to the index
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  18. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git status
    Show the working tree status
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  19. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git commit
    Record changes to the repository
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  20. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git log
    Show commit logs
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  21. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git diff
    Show changes between commits,
    commit and working tree, etc
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  22. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git branch
    List, create, or delete branches
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  23. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git checkout
    Checkout a branch or paths to the
    working tree
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  24. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    git tag
    Create, list, delete or verify a tag
    object signed with GPG
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule

    View Slide

  25. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git pull
    Fetch from and merge with another
    repository or a local branch

    View Slide

  26. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git fetch
    Download objects and refs from
    another repository

    View Slide

  27. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git merge
    Join two or more development
    histories together

    View Slide

  28. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git rebase
    Forward-port local commits to the
    updated upstream head

    View Slide

  29. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git push
    Update remote refs along with
    associated objects

    View Slide

  30. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git clone
    Clone a repository into a new
    directory

    View Slide

  31. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git reset
    Reset current HEAD to the
    specified state

    View Slide

  32. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git rm
    Remove files from the working tree
    and from the index

    View Slide

  33. Installing Git
    First Git project
    Basic Commands
    init
    add
    status
    commit
    log
    diff
    branch
    checkout
    tag
    pull
    fetch
    merge
    rebase
    push
    clone
    reset
    rm
    submodule
    git submodule
    Submodules allow foreign repositories
    to be embedded within a dedicated
    subdirectory of the source tree,
    always pointed at a particular commit.

    View Slide

  34. A successful Git
    branching model
    http:/
    /nvie.com/posts/a-successful-git-branching-model/

    View Slide

  35. View Slide

  36. https:/
    /github.com

    View Slide

  37. What is Github?
    Github is a powerful collaboration, code review, and
    code management tool for open source and private
    projects.

    View Slide

  38. About Github
    Founded in 2008
    2013
    more than 3 million users and 5 million
    repositories
    Free for Open Source projects

    View Slide

  39. Using Github

    View Slide

  40. Create an account
    (demo)
    https:/
    /github.com/
    Using Github

    View Slide

  41. Set Up Git for Github
    create the SSH key
    Using Github

    View Slide

  42. # generate the SSH Key
    $ ssh-keygen -t rsa -C "[email protected]"
    # Add your SSH key to Github
    $ cat ~/.ssh/id_rsa.pub
    # test if everything is working properly
    $ ssh -T [email protected]
    Create the SSH key
    Using Github
    Set Up Git for Github

    View Slide

  43. Create a repository
    (demo)
    Using Github

    View Slide

  44. Fork a repository
    (demo)
    Using Github

    View Slide

  45. Manage a repository
    (demo)
    Using Github

    View Slide

  46. Resources
    http:/
    /git-scm.com/
    http:/
    /git-scm.com/book
    http:/
    /gitref.org/
    https:/
    /www.kernel.org/pub/software/scm/git/docs/
    http:/
    /nvie.com/posts/a-successful-git-branching-model/
    https:/
    /github.com/

    View Slide

  47. @danielcsgomes | [email protected] | http://danielcsgomes.com
    Jian Awe © http://www."ickr.com/photos/qqjawe/6511141237
    Questions?

    View Slide