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
250
Ruby 2.0 Stroll
amirf
3
530
SCM Explained
amirf
2
290
Other Decks in Programming
See All in Programming
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
690
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
Data-Centric Kaggle
isax1015
2
770
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
210
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.5k
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.1k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Docker and Python
trallard
47
3.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Navigating Team Friction
lara
192
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
Are puppies a ranking factor?
jonoalderson
1
2.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
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!