This document introduces version control systems and Git. It discusses the history and features of Git, how it differs from centralized and local version control systems in using a distributed and non-linear model. The document then provides a tutorial on basic Git commands and workflows for initializing and cloning repositories, tracking and committing changes, viewing history and undoing changes, working with remote repositories, tagging, and using branches.
GraphAware - Transforming policing with graph-based intelligence analysis
Git: be social
1. Git: Be Social
Geronimo Orozco
gorozco @ gmail.com
Sept 2011
2. ● General introduction:
– Who I am
– Brief intro to VCS
● What is VCS
Scope
● Why do we need it
● Types of VCS
– Git
● History
● What is Git
● General features
● Traditional Way
● The Git way
● The Three states
● The basic workflow
● Tutorial
● Talk highly based on Pro Git (Seriously
this is just a extract and you should read the
book)
3. Who am I ?
(or why you should listen to me)
● Open Source Advocate User & Developer
– 4 years in QA
– 6 years as SysAdmin
– 6 years as Software Developer
– YaCOMAS (2004 released as GPL)
4. Who am I ?
(or why you should listen to me)
● Open Source Advocate User & Developer
– 4 years in QA
– 6 years as SysAdmin
– 6 years as Software Developer
– YaCOMAS (2004 released as GPL)
● I messed up too many times.
5. Version Control Systems
● Simple:
– VCS lets you track your files over time.
●
●
●
●
2012/10/01
Poem:
2012/10/02
Poem:
Roses are red,
violets are blue
6. Version Control Systems
● Simple:
– VCS lets you track your files over time.
●
●
●
2012/10/01
Poem:
2012/10/02
● Why do you care?
Poem:
Roses are red,
violets are blue
7. Version Control Systems
● Simple:
– VCS lets you track your files over time.
●
●
●
2012/10/01
Poem:
2012/10/02
Roses are red,
violets are blue
● Why do you care?
2012/10/03
– So when you mess up you can easily get back
to a previous working version.
Roses are red,
violets are blue
i tought i was ugly
but then i met you
8. Version Control Systems
● Why do we need it:
– Backup and Restore
– Synchronization.
– Short-term undo
– Long-term undo
– Track Changes
– Track Ownership
– Sandboxing
– Branching and merging
12. History of Git
● Originally Developed by Linus Torvalds
● Currently Maintained by Junio Hamano
● Born to Manage Linux Kernel Development
● Open Source, free (GNU GPL V2)
13. History of Git
● Originally Developed by Linus Torvalds
● Currently Maintained by Junio Hamano
● Born to Manage Linux Kernel Development
● Open Source, free (GNU GPL V2)
English slang for a stupid or unpleasant
person.
Torvalds said: "I'm an egotistical bastard,
and I name all my projects after myself.
First 'Linux', now 'git'."
14. What is Git?
● Distributed Source Control Management tool
● Born to Manage Linux Kernel Development
● Open Source, free (GNU GPL V2)
15. General features
● Speed
● Simple design
● Strong support for non-linear development
(thousands of parallel branches)
● Fully distributed
● Able to handle large projects like the Linux
kernel efficiently (speed and data size)
16. a list of file-based changes
(traditional way)
18. The Git way
● Nearly Every Operation Is Local
– Most operations in Git only need local files and
resources to operate
● Git Has Integrity
– Everything in Git is check-summed before it is
stored and is then referred to by that
checksum.
● Git Generally Only Adds Data
20. The basic workflow
● You modify files in your working directory.
● You stage the files, adding snapshots of them
to your staging area.
● You do a commit, which takes the files as they
are in the staging area and stores that
snapshot permanently to your Git directory.
23. Git setup
● General
– $ git config --global user.name "John Doe"
– $ git config --global user.email johndoe@example.com
● Your Editor
– $ git config --global core.editor vim
● Your Diff Tool:
– $ git config --global merge.tool vimdiff
● Check your settings:
– $ git config --list
24. Getting help
● $ git help <verb>
● $ git <verb> --help
● $ man git-<verb>
● Ex:
– $ git help config
25. Git Basics - Recording Changes to the
Repository
26. Git Basics - Getting a Git Repository
Initializing a Repository in an Existing Directory
$ git init
– This creates a new subdirectory named .git
(The git directory)