Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
7
530
git (Agile Day)
Introduction to Git. A presentation I gave at Agile Day.
Mindaugas Mozūras
May 22, 2012
Tweet
Share
More Decks by Mindaugas Mozūras
See All by Mindaugas Mozūras
Sustainable Speed
mmozuras
0
630
The Secret
mmozuras
0
310
Am I Still Productive?
mmozuras
0
480
The Three Last Conversations
mmozuras
0
410
Vinted Adventure
mmozuras
0
450
Frequent Releases & Major Changes
mmozuras
1
1.1k
Engineering for Engineering's Sake
mmozuras
1
1.6k
Life Embetterment With Hundreds of Deployments a Day
mmozuras
1
550
How to Build an Open Source Project in 3 Years
mmozuras
2
600
Other Decks in Programming
See All in Programming
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
900
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
24
21k
GeistFabrik and AI-augmented software development
adewale
PRO
0
230
Micro Frontendsで築いた 共通基盤と運用の試行錯誤 / Building a Shared Platform with Micro Frontends: Operational Learnings
kyntk
1
1.9k
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
2
670
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
200
エディターってAIで操作できるんだぜ
kis9a
0
600
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
10k
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
410
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
130
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
550
チーム開発の “地ならし"
konifar
8
6.9k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
The Language of Interfaces
destraynor
162
25k
Documentation Writing (for coders)
carmenintech
76
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Building Adaptive Systems
keathley
44
2.9k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
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!