7. What is version control?
⢠A system that keeps records of your
changes
⢠Allows for collaborative development
⢠Allows you to know who made what
changes and when
⢠Allows you to revert any changes
and go back to a previous state
8.
9. Git is a version control system!
⢠Distributed version control
⢠Users keep entire code and history
on their location machines
⢠Users can make any changes without
internet access
⢠(Except pushing and pulling changes
from a remote server)
10. What is git?
⢠Started in 2005
⢠Created by Linus Torvald to aid in
Linux kernel development
Git icon
11.
12. What is git?
⢠Git isnât the only version control
system
⢠But (we think) itâs the best
13.
14. How does git work?
⢠Can be complicated at first, but
there are a few key concepts
⢠Important git terminology in
following slides are blue
15. Key Concepts: Snapshots
⢠The way git keeps track of your code
history
⢠Essentially records what all your files look
like at a given point in time
⢠You decide when to take a snapshot, and
of what files
⢠Have the ability to go back to visit any
snapshot
16. Key Concepts: Commit
⢠The act of creating a snapshot
⢠Can be a noun or verb
âI commited codeâ
âI just made a new commitâ
⢠Essentially, a project is made up of
a bunch of commits
17. Key Concepts: Commit
â˘âŻ Commits contain three pieces of
information:
1. Information about how the files
changed from previously
2. A reference to the commit that came
before it â˘âŻ Called the âparent commitâ
3. A hash code name
â˘âŻ Will look something like:
fb2d2ec5069fc6776c80b3ad6b7cbde3cade4e
19. Key Concepts: Repositories
⢠Often shortened to ârepoâ
⢠A collection of all the files and
the history of those files
⢠Consists of all your commits
⢠Can live on a local machine or on a
remote server (GitHub!)
20. Key Concepts: Cloning
⢠The act of copying a repository
from a remote server is called
cloning
⢠Cloning from a remote server
allows teams to work together
21. Key Concepts: Pulling
⢠The process of downloading commits
that donât exist on your machine
from a remote repository is called
pulling changes
22. Key Concepts: Pushing
⢠The process of adding your local
changes to the remote repository is
called pushing changes
23.
24. How do you make a commit anyway?
⢠There are a lot of âstatesâ and âplacesâ
a file can be
⢠Local on your computer: the âworking
directoryâ
⢠When a file is ready to be put in a
commit you add it onto the âindexâ or
âstagingâ
25. The process:
⢠Make some changes to a file
⢠Use the âgit addâ command to put the
file onto the staging environment
⢠Use the âgit commitâ command to
create a new commitâ
26.
27.
28. What is GitHub?
⢠Largest web-based git repository
hosting service
⢠Allows for code collaboration with
anyone online
⢠Adds extra functionality on top of git
⢠UI, documentation, bug tracking, feature
requests, pull requests, and more!
29. What is GitHub?
⢠Founded in 2008
⢠Also has an Enterprise edition
for businesses
30.
31. Additional Resources
⢠Official git site and tutorial:
https://git-scm.com/
⢠GitHub guides:
https://guides.github.com/
⢠Command cheatsheet:
https://training.github.com/kit/
downloads/github-git-cheat-sheet.pdf