On Github CTS-NL / GIT.Presentation
Presented by Tim Oram
Created in cooperation with the Computer Technology Society of NL
Presentation on the Git version control systemWhy you should use a VCS?
What and why Git?
The basics of using Git?
Create
Edit
Save
Repeat
A typical work flow of a software developer.Why you made a change?
When you made the change?
What changes were made?
Who made the change?
We add the question who made the change.The first 10 years of the Linux kernel used tarballs.
You get the when, the what,
but not the why
and tarballs are difficult.
When from the file name.
What from a diff of the contents of the tarballs.
Tar create command can be clumsy.
Diff on two tar balls is painful.
You get the who,
but it is very messy
and which version is newer?
Developed by Linus Torvalds in 2005
for the linux kernel because
the previous tool they used was no longer available
and everything else sucked.
They were either slow, complicated
did not handle large projects well,
or were not distributed.
Git is fast!
Has one of the best branching systems.
Fully distributed, no central server.
Local, no network connection required.
Server is required for most operations
Server connection lost?
No version control
Every developer has their own copy
with their own history
to which they can push and pull to others.
Seems confusing, right?
GitHub can act like a central server
Repository
Staging area
Working directory
The .git directory
Where your history is stored
Where you commit files
Where you construct your commit
Layer between you and the repository
Current copy of the repository
Actual files and directories
What you use and modify
Modify files in the working directory
Add files to the staging area
Commit the staging area to the repository
Checkout files from the repository to the working directory
Initialize in the current directory
or under the directory provided.
Clone in a remote repository.
Shows the state of the repository
Files Git is tracking but have not been modified
Not shown by git status
Add a single file
Recursively add folders
Combined
Remove a single file
Remove a directory and all the files contained
The status
Remove file from stage
Remove folder from stage
The status
Checkout a single file
Check out a folder
Status
Hosted on a network
You can have one or many
Collaborate with others by pushing and pulling data
Including the InternetAdd a remote
List remotes
Remove remotes
Push to a remote
Pull from a remote