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
190
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
610
Code Review (Navy Hackathon)
rantav
0
83
Infrastructure Testing Using Kubernetes And Golang
rantav
0
94
Infrastructure testing using Kubernetes
rantav
0
550
Interview Workshop - Technical Questions
rantav
0
340
Code Review Best Practices
rantav
0
96
Code Review @ AppsFlyer
rantav
0
94
GraphQL at Yodas
rantav
2
170
Git for champs
rantav
0
150
Other Decks in Programming
See All in Programming
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
420
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
320
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
11
10k
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
540
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
0
1.1k
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.1k
Bakuraku E2E Scenario Test System Architecture #bakuraku_qa_study
teyamagu
PRO
0
710
CSC509 Lecture 11
javiergs
PRO
0
310
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
560
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
350
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
110
Java_プロセスのメモリ監視の落とし穴_NMT_で見抜けない_glibc_キャッシュ問題_.pdf
ntt_dsol_java
0
140
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Speed Design
sergeychernyshev
32
1.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Building Adaptive Systems
keathley
44
2.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
970
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Unsuck your backbone
ammeep
671
58k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
1.8k
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)