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 for SVN users, Tech talk week @ outbrain
Search
Ran Tavory
September 07, 2014
Programming
2
170
Git for SVN users, Tech talk week @ outbrain
Ran Tavory
September 07, 2014
Tweet
Share
More Decks by Ran Tavory
See All by Ran Tavory
go-grpc-channelz: a Go based UI for gRPC's channelz
rantav
0
460
Code Review (Navy Hackathon)
rantav
0
49
Infrastructure Testing Using Kubernetes And Golang
rantav
0
57
Infrastructure testing using Kubernetes
rantav
0
470
Interview Workshop - Technical Questions
rantav
0
300
Code Review Best Practices
rantav
0
61
Code Review @ AppsFlyer
rantav
0
60
GraphQL at Yodas
rantav
2
170
Git for champs
rantav
0
140
Other Decks in Programming
See All in Programming
A New Era of Testing
mannodermaus
2
530
Ruby Parser progress report 2024
yui_knk
2
230
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
210
Why Prism?
kddnewton
4
1.7k
API Platform for Laravel
dunglas
1
610
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
130
What is Parser
yui_knk
9
4.2k
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
0
390
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
For a Future-Friendly Web
brad_frost
174
9.3k
GitHub's CSS Performance
jonrohan
1030
450k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Testing 201, or: Great Expectations
jmmastey
36
7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
227
52k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
A better future with KSS
kneath
235
17k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
Transcript
Git Introduction For Subversion Users Ran Tavory Attributed to Totango
Who am I • A Developer, of course… • Migrated
two teams from SVN to Git • Gormim
None
Why git?
Why Git? • IT IS BETTER. There’s a site for
that.
Git is a File System
All (most) Operations are Local and Fast! • Commit •
Log (view history) • Diff • ...
Git is Distributed
Git is Fast
Lightweight (and local) Branching
Data Integrity
Staging Area
Stash Area
None
Setup
Git Setup $ brew install git! $ git config --global
user.name “Ran Tavory”! $ git config --global user.email “
[email protected]
” https://gist.github.com/rantav/ 5d6fb14057f062ecbc70
GitHub Setup https://help.github.com/articles/ set-up-git
Clone the Repo $git clone https://github.com/ rantav/devdev.git
The Basics
git status
git add
git diff
git diff More here: http://www.gitguys.com/topics/git-diff/
git commit
git commit --amend
git checkout
git rm
git mv
git log
git log -p
git log --word-diff
git log --stat
git log hacking
git remote
git pull
To rebase or not to rebase? • Prefer rebase •
this keeps the commit log cleaner •git pl! • Sometimes an actual merge is needed • So don’t rebase • For example, when merging branches
git push
SVN Parallels
Git for SVN
Git for SVN
Git for SVN
Git Lifecycle
Git Lifecycle
The Staging Area (AKA The Index)
Branching
Text http://pcottle.github.io/learnGitBranching/?demo A cool demo
Branching
Branching
Branching - Merging (fast forward)
Branching - Deleting
Branching cont
Branching - Merging (3 way merge)
Branching - Management
Branching - Remote
Branching - Remote
Branching - Remote
Branching - Remote git pull == git fetch && git
merge
Branching - Pushing Requires tracking
Deleting Remote Branches
Pull Requests
Creating a Pull Request 1 2 3 4
Reviewing a Pull Request
Merging Pull Request Online
Merging Pull Requests Offline •Resolve Conflicts •Test •Improve
Deleting Branch After PR Merge
Git Flow
None
1. Create a Branch git co -b bug-157 Branch Naming:
bug-xxx! feature-yyy! wip-zzz
2. Add Commits Commit messages are super important!!!
3. Open a Pull Request Make sure you assign a
reviewer!
4. Discuss AKA Code Review Continue to commit and push.
This will be reflected
5. Merge Merge means: It’s good for production. master is
always deployable
Pull Request Demo
Code Review
Code Review
Protips
Protip: How to transition your team from svn to git
1. Use git-svn, or Svn2git 2. Start using git “as svn” eg no branches 3. Start using branches and pull requests (if github) 4. Personal opinion: Use only CLI tools
Protip: git rebase -i
Protip: zsh integration
Protip: git stash
Extra
Conflicts
Conflicts Edit Collision # Edit file and then $ git
add! $ git commit
Conflicts Removed File
Conflicts Removed File - Keep
Conflicts Removed File - Remove
Conflicts Git Mergtool • Not covered here... • http://git-scm.com/docs/git-mergetool
Conflicts While Rebasing
Learning More
Refs http://git-scm.com/about http://thkoch2001.github.io/whygitisbetter/ http://www.slideshare.net/manishchaks/subversion- to-git-migration http://www.git-tower.com/blog/git-for-subversion- users-cheat-sheet-detail/ http://git.or.cz/course/svn.html (or: where
did I steal from?)
Refs https://help.github.com/articles/resolving-a-merge-conflict- from-the-command-line http://pcottle.github.io/learnGitBranching/ http://jeffkreeftmeijer.com/2010/the-magical-and-not- harmful-rebase/ https://help.github.com/articles/using-pull-requests https://help.github.com/articles/creating-a-pull-request http://en.wikipedia.org/wiki/ Coupling_(computer_programming)