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
Git - I'm lovin' it
Search
Amir Friedman
March 19, 2013
Programming
5
190
Git - I'm lovin' it
A short presentation about using git for beginners
Amir Friedman
March 19, 2013
Tweet
Share
More Decks by Amir Friedman
See All by Amir Friedman
Ruby Meta-Programming for beginners
amirf
1
240
Ruby 2.0 Stroll
amirf
3
520
SCM Explained
amirf
2
240
Other Decks in Programming
See All in Programming
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
490
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
210
Domain-Driven Transformation
hschwentner
2
1.9k
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.3k
Formの複雑さに立ち向かう
bmthd
1
720
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
CNCF Project の作者が考えている OSS の運営
utam0k
5
690
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
270
最近のVS Codeで気になるニュース 2025/01
74th
1
250
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
4.1k
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.1k
ARA Ansible for the teams
kksat
0
150
Featured
See All Featured
It's Worth the Effort
3n
184
28k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
How GitHub (no longer) Works
holman
313
140k
BBQ
matthewcrist
86
9.5k
Speed Design
sergeychernyshev
25
780
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
29
2.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Agile that works and the tools we love
rasmusluckow
328
21k
Navigating Team Friction
lara
183
15k
RailsConf 2023
tenderlove
29
1k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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!