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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Amir Friedman
March 19, 2013
Programming
200
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
260
Ruby 2.0 Stroll
amirf
3
530
SCM Explained
amirf
2
320
Other Decks in Programming
See All in Programming
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
210
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.5k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
180
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
200
テーブルをDELETEした
yuzneri
0
130
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
130
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
210
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.8k
AIエージェントで 変わるAndroid開発環境
takahirom
2
770
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
370
Foundation Models frameworkで画像分析
ryodeveloper
1
500
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Unsuck your backbone
ammeep
672
58k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Paper Plane
katiecoart
PRO
2
52k
Designing for Timeless Needs
cassininazir
1
430
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
530
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
680
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
BBQ
matthewcrist
89
10k
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!