Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Learning Git
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Rob Dumas
October 16, 2012
Technology
5.1k
5
Share
Learning Git
From a talk I gave to the Chicagoland Library Drupal Group.
Rob Dumas
October 16, 2012
More Decks by Rob Dumas
See All by Rob Dumas
Git in 5 Minutes
bitsandbooks
9
2k
Other Decks in Technology
See All in Technology
「気づいたら仕事が終わっている」バクラクAIエージェント本番運用の裏側 / layerx-bakuraku-aie2026
yuya4
18
10k
Platform engineering for developers, architects & the rest of us (AI agents)
danielbryantuk
0
180
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
1.8k
Agentic Web
dynamis
1
130
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
350
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
2.7k
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
500
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
180
新規事業を牽引する技術選定 〜フルスタックTypeScript開発の実践事例〜
nullnull
3
340
LLMを「主役」にしないための 3つの原則
techtekt
PRO
0
110
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
6
3.8k
探して_入れて_作って_使う_Agent_Skills___LT.pdf
peintangos
2
160
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
We Have a Design System, Now What?
morganepeng
55
8.2k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Building AI with AI
inesmontani
PRO
1
1.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Everyday Curiosity
cassininazir
0
220
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
Ruling the World: When Life Gets Gamed
codingconduct
0
250
Facilitating Awesome Meetings
lara
57
6.9k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
570
The browser strikes back
jonoalderson
0
1.1k
Transcript
version control
rob dumas chicago public library @stray
✓why version control? ✓installing git ✓your first repository ✓branching &
merging in this lecture:
r2d.to/gitstart links
we’re all victims of data loss; some of us just
don’t know it…yet.
BACKUPS ARE REALLY F**KING IMPORTANT photo credit: alexander muse (flic.kr/p/noL2K)
snapshots
snapshots
1.0 2.0 3.0 4.0 5.0 developers work in teams and
need to track the changes to their code over time
version control
version control change joel on software: “distributed version contol is
here to say, baby” (r2d.to/QJw8lr)
✓ what files have changed ✓ who made those changes
✓ when the changes were made ✓ how those changed files differ ✓ why they were changed (hopefully) accountability
wikipedia record of changes to articles over time
git-scm.com
what’s so GREAT about git?
✓ no cost (“free as in beer”) ✓ gpl version
2 (“free as in speech”) gnu.org/licenses/gpl-2.0.html git is free & open source
✓ built for any size group ✓ encourages non-linear development
✓ complete local repositories git is local & distributed
✓ “deltas” for efficiency (binary files stored whole) ✓ cryptographically-authenticated
history using SHA1 hashes ✓ commits are atomic git is fast & secure
git is stable & popular
installing git git-scm.com/downloads sudo apt-get install git brew install git
(or yum) (requires xcode & homebrew)
git-scm.com/downloads/guis baked right in other git gui apps textmate bundle
netbeans xcode and more!
for windows users peepcode.com/products/ meet-the-command-line
is git installed? $ git -‐-‐version git version 1.7.12.1
~/.gitconfig $ git config -‐-‐global user.name "Joe User" $
git config -‐-‐global user.email "
[email protected]
"
basic workflow create/ clone repository make changes commit changes stage
changes 1 2 3 4
photo credit: muy yum (flic.kr/p/7ByV6Y) stage work area git
git basics
creating a repository $ mkdir myproject $ cd myproject $
git init Initialized empty Git repository in ~/myproject/.git/
myproject/.git/ don’t touch these files!
cloning a repository $ git clone REPO_LOCATION Cloning into 'myproject'...
remote: Counting objects: 36, done. remote: Compressing objects: 100% (33/33), done. remote: Total 36 (delta 10), reused 29 (delta 3) Receiving objects: 100% (36/36), 7.13 KiB, done. Resolving deltas: 100% (10/10), done. folder or URL
repo status (“clean”) $ git status # On branch master
nothing to commit (working directory clean)
repo status (“dirty”) $ git status # On branch master
# Untracked files: # (use "git add <file>..." to include in what will be committed) # # myfile.html nothing added to commit but untracked files present (use "git add" to track)
adding files $ git add myfile.html you have to add
the files you’ve changed each time you commit!
repo status (staged) $ git status # On branch master
# Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: myfile.html #
committing changes $ git commit -‐m "Added new file,
myfile.html, to repo." [master (root-‐commit) b80da17] Added new file, myfile.html, to repo. 0 files changed create mode 100644 myfile.html
other commands $ git log $ git diff COMMIT_HASH $
git rm $ git mv
.gitignore nuclear-‐launch-‐codes.txt source/* *.temp put files, folders and patterns in
this file to tell git to ignore them.
branching & merging
master
master dev
master dev
creating a branch $ git branch awesome $ git checkout
awesome Switched to branch 'awesome'
merging a branch $ git checkout master Switched to branch
'master' $ git merge awesome Updating 5bed678..217f575 Fast-‐forward myfile.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 myfile.txt
the ‘stache
the stash $ git stash $ git stash apply $
git stash list $ git stash drop STASH_ID
v1.0 master dev tagging
tagging $ git tag -‐a v1.0 -‐m "Product release"
$ git tag -‐a ronburgundy -‐m "Brick killed a guy with a trident."
distributed git
push & pull $ git push origin master $ git
pull origin master
git on the server ✓your own git server ✓github
github image source: the octodex (octodex.github.com)
further reading
get started with git alistapart.com/articles/get-started-with-git
Version Control with Git 2nd. Edition by Loeliger & McCullough
© 2012 O’Reilly Media ISBN 978-1-4493-1638-9 r2d.to/oreillygitbook
r2d.to/gitstart links
thank you!