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

git & github

git & github

An introduction to git and GitHub.

Trevor Strieber

October 14, 2013
Tweet

More Decks by Trevor Strieber

Other Decks in Programming

Transcript

  1. git & github
    trevor strieber

    View Slide

  2. who am i?
    ARMSTRONG GRADUATE
    SOFTWARE DEVELOPER
    ATLANTIC
    TELE-NETWORK
    @

    View Slide

  3. what is git?

    View Slide

  4. source code
    management
    git
    is a
    SYSTEM

    View Slide

  5. git
    keeps track of changes
    IN YOUR CODE

    View Slide

  6. git
    works

    View Slide

  7. git
    makes it easier to work
    AS A TEAM

    View Slide

  8. View Slide

  9. what is

    View Slide

  10. View Slide

  11. github
    is a place to store your
    CODE

    View Slide

  12. github
    IS

    View Slide

  13. github
    IS DISTRIBUTION

    View Slide

  14. github
    IS DISTRIBUTION

    View Slide

  15. github
    is a

    View Slide

  16. github
    is a
    social network

    View Slide

  17. github
    is a
    social network
    for NERDS

    View Slide

  18. github
    is a
    social network
    for NERDS

    View Slide

  19. github
    is a
    social network
    for DEVELOPERS

    View Slide

  20. HOW DOES IT

    View Slide

  21. installation
    WINDOWS
    MSYSGIT
    http://msysgit.github.io/

    View Slide

  22. installation
    OSX
    GIT
    already installed

    View Slide

  23. installation
    OSX
    WANT NEWER GIT?
    check out homebrew
    http://brew.sh/

    View Slide

  24. installation
    LINUX
    USE YOUR
    package manager

    View Slide

  25. installation
    LINUX
    Ubuntu / Mint
    apt-get

    View Slide

  26. installation
    LINUX
    CentOS / Fedora
    yum

    View Slide

  27. CREATING
    A REPOSITORY

    View Slide

  28. git init
    [trevor:~/sweet_app]$ git init
    Initialized empty Git repository in /home/trevor/sweet_app/.git/

    View Slide

  29. NOW WHAT?

    View Slide

  30. NOW WHAT?

    View Slide

  31. edit files
    [trevor:~/sweet_app]$ vim hello_world.rb

    View Slide

  32. [trevor:~/sweet_app]$ git status
    # On branch master
    #
    # Initial commit
    #
    # Untracked files:
    # (use “git add …” to include in what will be committed)
    #
    # hello_world.rb
    git status

    View Slide

  33. TRACKING
    new files

    View Slide

  34. [trevor:~/sweet_app]$ git add hello_world.rb
    git add

    View Slide

  35. HOW ARE WE
    looking?

    View Slide

  36. [trevor:~/sweet_app]$ git status
    # On branch master
    #
    # Initial commit
    #
    # Changes to be committed:
    # (use “git rm --cached …” to unstage
    #
    # new file: hello_world.rb
    git status

    View Slide

  37. WHAT IS A
    commit?

    View Slide

  38. COMMIT:
    a snapshot of your code

    View Slide

  39. [trevor:~/sweet_app]$ git commit –m ‘Initial commit!’
    [master (root-commit) f888f95 Initial commit!
    1 files changed, 2 insertions(+), 0 deletions(-)
    create mode 100644 hello_world.rb
    git commit

    View Slide

  40. CLEAN:
    no unsaved changes

    View Slide

  41. [trevor:~/sweet_app]$ git status
    # On branch master
    Nothing to commit (working directory clean)
    git status

    View Slide

  42. SHARING

    View Slide

  43. GitHub

    View Slide

  44. create a repository

    View Slide

  45. pick a name
    get the URL

    View Slide

  46. connect the
    repositories

    View Slide

  47. [trevor:~/sweet_app]$ git remote add origin \
    https://github.com/TrevorS/sweet_app.git
    git remote

    View Slide

  48. upload your
    changes

    View Slide

  49. [trevor:~/sweet_app]$ git push –u origin master
    Username for ‘https://github.com’: TrevorS
    Password for ‘https://[email protected]’:
    Counting objects 3, done.
    Writing objects: 100% (3/3), 258 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To https://github.com/TrevorS/sweet_app.git
    * [new branch] master -> master
    Branch master set up to track remote branch master from origin.
    git push

    View Slide

  50. ADMIRE
    YOUR RESULTS

    View Slide

  51. these are the basics

    View Slide

  52. these are the basics
    LEARN MORE

    View Slide

  53. these are the basics
    LEARN MORE
    SHOW OFF

    View Slide