Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
git (Agile Day)
Search
Mindaugas Mozūras
May 22, 2012
Programming
580
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
Transcript
79 slides
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!
More Decks by Mindaugas Mozūras
See All by Mindaugas Mozūras
Sustainable Speed
mmozuras
0
680
The Secret
mmozuras
0
390
Am I Still Productive?
mmozuras
0
560
The Three Last Conversations
mmozuras
0
450
Vinted Adventure
mmozuras
0
500
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
620
How to Build an Open Source Project in 3 Years
mmozuras
2
670
Other Decks in Programming
See All in Programming
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
210
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
200
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
200
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
350
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
650
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
210
SODA - FACT BOOK(EN)
sodainc
1
260
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
410
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
240
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
400
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
We Are The Robots
honzajavorek
0
450
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
4 Signs Your Business is Dying
shpigford
187
23k
Balancing Empowerment & Direction
lara
6
1.4k
Abbi's Birthday
coloredviolet
5
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
WCS-LA-2024
lcolladotor
0
1k
Writing Fast Ruby
sferik
630
63k
Navigating Team Friction
lara
192
16k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.9k