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 (Agile Day)
Search
Mindaugas Mozūras
May 22, 2012
Programming
560
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
git (Agile Day)
Introduction to Git. A presentation I gave at Agile Day.
Mindaugas Mozūras
May 22, 2012
More Decks by Mindaugas Mozūras
See All by Mindaugas Mozūras
Sustainable Speed
mmozuras
0
660
The Secret
mmozuras
0
360
Am I Still Productive?
mmozuras
0
530
The Three Last Conversations
mmozuras
0
440
Vinted Adventure
mmozuras
0
490
Frequent Releases & Major Changes
mmozuras
1
1.2k
Engineering for Engineering's Sake
mmozuras
1
1.7k
Life Embetterment With Hundreds of Deployments a Day
mmozuras
1
590
How to Build an Open Source Project in 3 Years
mmozuras
2
640
Other Decks in Programming
See All in Programming
自作OSでスライド発表する
uyuki234
1
3.9k
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
16k
関数型プログラミングのメリットって何だろう?
wanko_it
0
200
5分で問診!Composer セキュリティ健康診断
codmoninc
0
630
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
200
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
360
霧の中の代数的エフェクト
funnyycat
1
430
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
130
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
540
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
210
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
A better future with KSS
kneath
240
18k
Are puppies a ranking factor?
jonoalderson
1
3.7k
The Invisible Side of Design
smashingmag
301
52k
Navigating Team Friction
lara
192
16k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
420
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
390
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Transcript
git or: how I learned to stop worrying and love
source control
None
why you should care
Traditional version control systems have deficiencies
Subversion, Perforce, CVS, TFS...
OH, THE PAIN! SLOW TREE CONFLICTS MERGING IS CHALLENGING BRANCHES
ARE JUST COPIES
using svn
using git
is awesome git
It’s distributed! Distributed Version Control System
Every repository is equal.
You can work offline.
Fast as lightning.
add status diff log commit branch git mercurial bazaar
Very efficient. git clone rails - 53 seconds 40mb, 2356
files, 29045 commits
Great branching and merging.
Any workflow you want, you got it...
Shared repository
Blessed repository Linus Torvalds Lieutenants Developers
how toinstall
Linux: apt-get install git-core Mac OS X: brew install git
Windows: chocolatey install msysgit
Download from git-scm.com
getting started
git config --global user.name ... git config --global user.email ...
git init
master has no special meaning. It’s just a default branch.
git add
Staging area stores info about what will go into next
commit.
working directory staging area repository commit checkout the project stage
files
git commit
189f30b664981e4397625791c8ea3bbb5f2279a3 Commit “name” is a 40-digit SHA
commit 189f30b... tree e8455... parent(s) nil author Mindaugas... committer Mindaugas...
Initial commit
tree e8455... blob bc52a... README.md
blob bc52a...
SVN, CVS, Perforce store differences between commits.
Git stores snapshots.
commit0 commit1 commit2 tree0 tree1 tree2 blob A blob B
blob A blob A2 blob B2 blob B2
Basic training complete.
and pushing pulling
git remote add origin git@git...
git push origin master
git pull origin master
and merging branching
git branch name
Branch is a reference to the head of a line
of work.
C0 C1 master feature
git checkout name
git merge name
C0 master C1 C2 F1 F2 feature
C0 master C1 C2 F1 F2 feature C3
git rebase name
C0 master C1 C2 F1 F2 feature
C0 master F2 C2 C1 F1 feature
merge is fine, but in a lot of cases, rebase
is better.
Branching - too easy not to do
manipulating history
git commit --amend
git rebase --interactive
Interactive rebase lets you: reword, edit, squash, fixup, exec, remove
and reorder.
You can change history of remote repository with git push
--force. Be careful!
Rewriting history is fun and useful!
svn git-
git svn clone http://...
git svn rebase ~ svn update
git svn dcommit ~ svn commit
GitHub
The best way to collaborate.
More than 1.6 million people, 2.8 million repositories.
Used by individuals.
None
And organizations.
None
thoughts closing
blame bisect cherry-pick clean cvsimport describe diff fetch filter-branch grep
request-pull revert svnimport stash submodule tag and more...
git-scm.com gitready.com gitimmersion.com ontwik.com/category/git-github RESOURCES
Git != Subversion + Magic
The slogan of Subversion for a while was "CVS done
right". If you start with that kind of slogan, there's nowhere you can go. There is no way to do CVS right. Linus Torvalds
Zach Holman @holman thenounproject.com thanks to:
codingfearlessly.com twitter.com/mmozuras github.com/mmozuras thanks!