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

Intro to Git and Github

Intro to Git and Github

Are you struggling to keep the source code up to date in group projects? Or have you heard about a technology used in the tech industry called Github and want to learn more? We'll start this session with a brief intro that will go over why you use version control and what problems you can solve with it. Then we'll dive into a hands-on tutorial using Git and Github. Attendees should have some knowledge of a programming language such as HTML, JavaScript, Python, or Java. Before the session, please signup for an account on GitHub

https://github.com/join

download Git for your operating system

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

and download SourceTree

https://www.sourcetreeapp.com

jlstrater

April 21, 2017
Tweet

More Decks by jlstrater

Other Decks in Technology

Transcript

  1. Intro to Git and Github Jenn Strater @codeJENNerator

  2. @codeJENNerator https://speakerdeck.com/jlstrater/intro-to-git-2017 Follow Along

  3. @codeJENNerator About Me

  4. @codeJENNerator About Me Starting at Zenjob in Berlin in June

    2017!
  5. @codeJENNerator About Me - Taking classes at the Technical University

    of Denmark and working on a research project - Also exploring Danish Culture with funding from the US Fulbright Grant program - Prior to the Fulbright Grant, I was a senior consultant at Object Partners, Inc. in Minneapolis, MN, USA. My work there is the subject of this talk. - Co-founder of Gr8Ladies and talk about women in the Groovy Community all over the world - Passionate about bring new people into the Groovy community through free introductory workshops called Gr8Workshops. - Moving to Berlin and starting at Zenjob in June 2017.
  6. @codeJENNerator Background

  7. @codeJENNerator Background • Programming Languages • Java • Python •

    JavaScript • R
  8. @codeJENNerator Background • Programming Languages • Java • Python •

    JavaScript • R
  9. @codeJENNerator Background • Programming Languages • Java • Python •

    JavaScript • R • Source Control • Git • Hg • Svn
  10. @codeJENNerator What is Version Control?

  11. @codeJENNerator https://vimeo.com/41027679

  12. @codeJENNerator https://vimeo.com/41027679

  13. @codeJENNerator Why use Versioning?

  14. None
  15. @codeJENNerator How can we version? • Change file names (file1,

    file2, filea, fileb, etc) • Use a tool with automatic save and revert i.e. Google Docs, Share Latex • Use a dedicated version control system
  16. @codeJENNerator Types of Version Control

  17. @codeJENNerator Centralized

  18. @codeJENNerator Examples • Subversion (SVN) • Concurrent Versions System (CVS)

  19. Problems

  20. @codeJENNerator Problems • Checkouts • Merges

  21. @codeJENNerator Distributed

  22. @codeJENNerator Advantages • easy to manage • better merge conflict

    resolution
  23. @codeJENNerator Examples • Git • Mercurial (Hg)

  24. @codeJENNerator

  25. @codeJENNerator Overview • a free and open source project •

    a protocol for versioning documents • can be used locally without a server • uses a tree structure • more videos: https://git-scm.com/videos
  26. @codeJENNerator Terms

  27. @codeJENNerator Terms • init

  28. @codeJENNerator Terms • init • clone

  29. @codeJENNerator Terms • init • clone • branch

  30. @codeJENNerator Terms • init • clone • branch • add

  31. @codeJENNerator Terms • init • clone • branch • add

    • commit
  32. @codeJENNerator Terms • init • clone • branch • add

    • commit • master
  33. @codeJENNerator Terms • init • clone • branch • add

    • commit • master • stash
  34. @codeJENNerator Terms • init • clone • branch • add

    • commit • master • stash • fetch
  35. @codeJENNerator Terms • init • clone • branch • add

    • commit • master • stash • fetch • pull
  36. @codeJENNerator Terms • init • clone • branch • add

    • commit • master • stash • fetch • pull • push
  37. @codeJENNerator Terms • init • clone • branch • add

    • commit • master • stash • fetch • pull • push • merge
  38. @codeJENNerator • Init - start a new project locally •

    Clone - copy everything to your local computer • Branch - create a space to make your changes without affecting anything else • Add - add files to be saved • Commit - create a save point • Master - the main branch (by default) for everyone
  39. @codeJENNerator • Stash - save your changes and come back

    to them later • Fetch - get any changes from the server • Pull - fetch any changes from your teammates and merge it into your current local copy • Merge - include changes into a branch • Merges can happen when you want to include your changes in the team project (after a push) • Merges also happen when you want to get your team members work onto your own machine (after a pull)
  40. @codeJENNerator Gui Source Tree

  41. @codeJENNerator Command Line >git init

  42. None
  43. @codeJENNerator Github img src: https://www.flickr.com/photos/24874528@N04/17125924230

  44. @codeJENNerator Github • a private for-profit company • hosts git

    source code repositories • helps you work as a team or with public groups • can also convert from svn, hg, or tfs to git • has a great UI for assisting with some common tasks • The logo is called the octocat ;)
  45. Profiles

  46. Organizations

  47. @codeJENNerator Repositories • private or part of an organization •

    can be ‘forked’ to make a copy from an existing project
  48. @codeJENNerator Repositories • private or part of an organization •

    can be ‘forked’ to make a copy from an existing project
  49. @codeJENNerator Repositories • private or part of an organization •

    can be ‘forked’ to make a copy from an existing project
  50. @codeJENNerator Read the docs for more on.. • Complex Branching

    and Rebasing • Enterprise Features • Using other git repositories like Bitbucket
  51. @codeJENNerator Conclusion

  52. @codeJENNerator

  53. @codeJENNerator • There are many ways to version documents

  54. @codeJENNerator • There are many ways to version documents •

    No matter the way, pick one that works for you.
  55. @codeJENNerator • There are many ways to version documents •

    No matter the way, pick one that works for you. • Commit early, commit often!
  56. @codeJENNerator Questions? https://flic.kr/p/5DeuzB

  57. @codeJENNerator Time for Tutorials!

  58. @codeJENNerator Hello World - Github GUI • https://guides.github.com/activities/hello-world/

  59. @codeJENNerator Code Academy (Free) • https://www.codecademy.com/learn/learn-git

  60. @codeJENNerator Basic Tutorial with Command Line • http://product.hubspot.com/blog/git-and-github- tutorial-for-beginners

  61. @codeJENNerator Learn Git with Bitbucket • https://www.atlassian.com/git/tutorials/learn-git-with- bitbucket-cloud

  62. @codeJENNerator Advanced

  63. @codeJENNerator Stashing • https://www.atlassian.com/git/tutorials/git-stash

  64. @codeJENNerator Complete Example • https://www.learnenough.com/git-tutorial • Starts very basic, but

    scroll down for more advanced topics
  65. @codeJENNerator List of More Tutorials • https://gist.github.com/jaseemabid/1321592

  66. @codeJENNerator Command Cheat Sheet • https://github.com/kennyyu/bootcamp-git/wiki/ Basic-git-workflow

  67. @codeJENNerator More Videos • https://git-scm.com/videos