Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Git - I'm lovin' it
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Amir Friedman
March 19, 2013
Programming
210
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git - I'm lovin' it
A short presentation about using git for beginners
Amir Friedman
March 19, 2013
More Decks by Amir Friedman
See All by Amir Friedman
Ruby Meta-Programming for beginners
amirf
1
270
Ruby 2.0 Stroll
amirf
3
540
SCM Explained
amirf
2
320
Other Decks in Programming
See All in Programming
小さなアプリを作って公開するまで
onozaty
0
120
LLM 101
dalinaum
0
470
Next.js: The final boss of Web Performance
guaca
0
380
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
340
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
510
オーケストレーション記述言語 Katari
yukikurage
0
220
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
530
はじめてのPLATEAU
nokonoko1203
1
530
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
AI-Powered Domain-Driven Design
ziobrando
0
390
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
140
Railsバージョンを4倍にした話
optim
0
930
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Google's AI Overviews - The New Search
badams
0
1.7k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
610
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Building Applications with DynamoDB
mza
96
7.3k
Building the Perfect Custom Keyboard
takai
2
950
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
500
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Transcript
Git I'm lovin' it!
My University Life
Introducing... Version Control • What changed? • Who changed? •
When did it change? • Why did it change?
Traditional Version Control • SLOW • COMPLICATED to branch •
Branches are COPIES • Merging is ANNOYING • SLOW • Not always free • Requires a centralized server • Can't always work offline A new world of PAIN
Why you should love git
None
Git == AWESOME • FAST • Developers can work offline
• Local Control • Much smaller compared to other repos, e.g: Mozilla (SVN), 30x smaller • Branches carry their entire history • DECENTRALIZED • ANY workflow is possible
How fast? Source: http://git-scm.com/about/small-and-fast pretty fast...
Getting Started
git config --global user.email <email> git config --global user.name <name>
* sometimes, git config --local
git init 8:45 ➜ restaurant> git init Initialized empty Git
repository in /Users/amirf/restaurant/.git/ 8:45 ➜ restaurant git:(master) ✗> Master is not special, it's just the default.
git clone 8:45 ➜ git clone
[email protected]
:funky-repo.git
3 types of files
untracked and not staged
staged
committed (added)
git add --all git add . git add <file>
git status 8:52 ➜ restaurant git:(master) ✗ git status #
On branch master # *snip snip* # # new file: rest_task1.c # 8:54 ➜ restaurant git:(master) ✗
git commit also - git commit -m <message> change last
message - git commit --amend
What is a commit? a 40 digits b107591703f6e5c767ee6bc34c3b19000672be8f SHA
git push git push origin <branch> 8:45 ➜ git push
origin master
What is HEAD? A reference to the last commit in
the current branch
git pull git pull origin <branch> 9:45 ➜ git pull
origin master
Basic Training Complete!
BRANCHING
git branch <name> 9:45 ➜ git branch new-feature
What is a branch? A reference to the head of
work somewhere
git checkout <name> 9:45 ➜ git checkout new-feature Switched to
branch new-feature
git checkout -b <name> Actually wraps: git branch <name> git
checkout <name>
git log [-p]
git diff <file>
git merge <name> 9:45 git:(master) ➜ git merge new-feature 9:45
git:(master) ➜ git merge remotes/origin/new-feature
git stash ➜ git stash save ➜ git stash list
➜ git stash pop ➜ git stash apply stash@{0} ➜ git stash drop stash@{0} the 'stash
git cherry-pick <commit>
git blame <file>
git reset --hard <commit> git reset --soft <commit>
DEMO TIME! Let's create a repository and do some branching,
merging and revet. ...and then let's do it on plugins-repo.
There's more Much, more. clean, fetch, tag, describe, rebase, stash,
revert - and many, many more.
To summerize
Resources Google. Thanks!