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

Git - A simple introduction

Git - A simple introduction

An intro to the git version control system aimed at non-technical users. Presented internally @SeatGeek

35ce1084ddd81008486fcc31170bec96?s=128

Jose Diaz-Gonzalez

August 12, 2014
Tweet

Transcript

  1. GIT a simple introduction

  2. 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
  3. file management Image from: http://hginit.com/01.html

  4. life without version control • Without version control, you can

    just keep multiple copies of files • Takes up disk space for larger files • Confusing as to which file is most up to date
  5. version control is for keep track of file changes

  6. git is for non-binary files • Hard to diff images

    and binary files • Who made the last change? How do you merge them? • Text files == git
  7. some key words • commit: a state of the repository

    at a single time • repository: a database containing your history and configuration • index/staging area: a cache between your working directory and your repository • clone: the act of copying a repository or a copy of the repository
  8. some key words • branch: a line of development. It’s

    a “label” that points to a commit • head: the top commit on a branch. Most recent in a branch’s history • upstream: a copy of a given repository. An “original” copy of the repository history • tag: a description of a given commit. Can be cryptographically signed.
  9. Usage of git

  10. showing changes

  11. showing change history

  12. edit the file and do a “git diff”

  13. and now add and commit the files

  14. What does git log about our repository?

  15. git shows change history by date descending

  16. delete a file!

  17. Unless you commit your changes

  18. git can revert to your previous history state

  19. checkout your previous repository state

  20. 1. Make some changes 2. See if they work 3.

    If they do, commit them 4. If they don’t, checkout your last state 5. GOTO 1 A git workflow
  21. git can only keep track of files you’ve told it

    about in the past
  22. use git add to stage a file into the git

    index
  23. use cases for git-like systems • tracking code history •

    mirroring the history of a set of files • collaborating with multiple users in a distributed fashion • sharing result-sets from commands • modifying docx files and sharing history quickly
  24. caveats • since git is distributed, not as fun alone

    • need to keep abreast of changes in the main remote branch • more annoying across multiple operating systems • lots of weird commands and states you have to deal with
  25. alternatives • dropbox! • layervault/version cue for photoshop • mercurial

  26. easy git clients • github for mac/windows • sourcetree for

    mac/windows • smartgit on windows • gitx for mac
  27. moar resources • github’s interactive tutorial: https://try.github.io/ levels/1/challenges/1 • git

    immersion: http://gitimmersion.com/ • code school: https://www.codeschool.com/courses/ try-git • pro git book (free): http://git-scm.com/book
  28. questions?