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
180
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
220
Ruby 2.0 Stroll
amirf
3
520
SCM Explained
amirf
2
220
Other Decks in Programming
See All in Programming
Code Reviews
bkuhlmann
4
900
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
970
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
300
Git Lint
bkuhlmann
4
760
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
Snowflakeで眠ったデータを起こそう!
estie
0
140
VS Code をプロダクトにどう取り込むか
onomax
1
650
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Git Rebase
bkuhlmann
11
1.6k
ServerAction で Progressive Enhancement はどこまで頑張れるか? / progressive-enhancement-with-server-action
takefumiyoshii
6
400
Goのエラースタックトレースの歴史と今後
sonatard
10
1.8k
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
1
500
Featured
See All Featured
Web Components: a chance to create the future
zenorocha
306
41k
GraphQLの誤解/rethinking-graphql
sonatard
55
9.3k
The Invisible Customer
myddelton
114
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
222
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Why Our Code Smells
bkeepers
PRO
331
56k
We Have a Design System, Now What?
morganepeng
44
6.8k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
What's in a price? How to price your products and services
michaelherold
238
11k
Designing with Data
zakiwarfel
96
4.8k
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!