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

Git demystified for non-programmers

Git demystified for non-programmers

Git is a version control system that has become extremely popular over the last decade. While primarily intended to manage software source code, it is finding increasing usage for other purposes and by people with varying professional backgrounds. This talk will explain the basic concepts, terms, and workflows of Git, as well as a small amount of its internal design to help improve understanding for people who are not computer programmers by trade.

Jimmy Cuadra

June 15, 2016
Tweet

More Decks by Jimmy Cuadra

Other Decks in Technology

Transcript

  1. $ tree . !"" chapters # !"" chapter_1.txt # !""

    chapter_2.txt # $"" chapter_3.txt !"" intro.txt $"" outro.txt
  2. $ git init Initialized empty Git repository in /Users/jimmy/Code/git- demystified/.git/

    $ git commit -m "Add intro, outro, and three chapters." [master (root-commit) bbedcbe] Add intro, outro, and three chapters. 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 chapters/chapter_1.txt create mode 100644 chapters/chapter_2.txt create mode 100644 chapters/chapter_3.txt create mode 100644 intro.txt create mode 100644 outro.txt
  3. $ git commit -m "Add intro, outro, and three chapters."

    [master (root-commit) bbedcbe] Add intro, outro, and three chapters. $ git cat-file -p e0e642a 040000 tree 5938ce63424981f08d17edff734614a825f781e2 chapters 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 intro.txt 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 outro.txt $ git cat-file -p 5938ce6 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 chapter_1.txt 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 chapter_2.txt 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 chapter_3.txt
  4. $ git commit -m "Add intro, outro, and three chapters."

    [master (root-commit) bbedcbe] Add intro, outro, and three chapters. 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 chapters/chapter_1.txt create mode 100644 chapters/chapter_2.txt create mode 100644 chapters/chapter_3.txt create mode 100644 intro.txt create mode 100644 outro.txt
  5. $ git cat-file -p bbedcbe tree e0e642ac3334754ff3f49e7ec6aa25241bdeeeda author Jimmy Cuadra

    <[email protected]> 1458099001 -0700 committer Jimmy Cuadra <[email protected]> 1458099001 -0700 Add intro, outro, and three chapters.
  6. $ git status On branch master Initial commit Untracked files:

    (use "git add <file>..." to include in what will be committed) chapters/ intro.txt outro.txt nothing added to commit but untracked files present (use "git add" to track)
  7. $ git status On branch master Initial commit Changes to

    be committed: (use "git rm --cached <file>..." to unstage) new file: intro.txt Untracked files: (use "git add <file>..." to include in what will be committed) chapters/ outro.txt
  8. $ git status On branch master Initial commit Changes to

    be committed: (use "git rm --cached <file>..." to unstage) new file: chapters/chapter_1.txt new file: chapters/chapter_2.txt new file: chapters/chapter_3.txt new file: intro.txt new file: outro.txt
  9. $ git commit -m "Add intro, outro, and three chapters."

    [master (root-commit) bbedcbe] Add intro, outro, and three chapters. 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 chapters/chapter_1.txt create mode 100644 chapters/chapter_2.txt create mode 100644 chapters/chapter_3.txt create mode 100644 intro.txt create mode 100644 outro.txt
  10. $ git log commit bbedcbefe51e206723ab5621d1717a660b8c0374 Author: Jimmy Cuadra <[email protected]> Date:

    Tue Mar 15 20:30:01 2016 -0700 Add intro, outro, and three chapters.
  11. SHA-1 $ git show -1 commit bbedcbefe51e206723ab5621d1717a660b8c0374 Author: Jimmy Cuadra

    <[email protected]> Date: Tue Mar 15 20:30:01 2016 -0700 Add intro, outro, and three chapters.
  12. origin Repository alice1 Bob Repository alice1 $ git remote add

    carol https://carol.example.com/repo.git $ git fetch carol bob1 carol Repository alice1 carol1
  13. Git is a history of snapshots of your project at

    each state throughout its life