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 and Hg
Search
David Newell
March 22, 2013
Programming
1
92
Git and Hg
A comparison of commands and concepts in git and hg
David Newell
March 22, 2013
Tweet
Share
More Decks by David Newell
See All by David Newell
CoffeeScript Intro
rustedgrail
2
96
Other Decks in Programming
See All in Programming
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
170
JETLS.jl ─ A New Language Server for Julia
abap34
2
470
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
230
gunshi
kazupon
1
130
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
150
Vibe codingでおすすめの言語と開発手法
uyuki234
0
150
Java 25, Nuevas características
czelabueno
0
120
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
860
これならできる!個人開発のすゝめ
tinykitten
PRO
0
140
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
450
マスタデータ問題、マイクロサービスでどう解くか
kts
0
170
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
620
Featured
See All Featured
Code Review Best Practice
trishagee
74
19k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
74
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
The Language of Interfaces
destraynor
162
26k
The Spectacular Lies of Maps
axbom
PRO
1
410
We Are The Robots
honzajavorek
0
130
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Curse of the Amulet
leimatthew05
0
6.5k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
Hg and Git A Fair(ish) comparison
BitKeeper and BitMover Troubles Git - April 3rd, 2005 -
April 18th, 2005: First Merge - Linus Torvald Hg - April 19th, 2005 - Matt Mackall History
Git - Snapshots Hg - Changesets Git and Hg -
mix of both for compression Tracking Changes
Git cherry-pick - diff 2 files - apply changeset Hg
graft - apply changes to previous snapshots - for source and destination - apply changeset Cherry-picking and Grafting
Pulling changes git pull git fetch hg pull -u git
merge hg merge git commit git commit hg commit
git pull --rebase in .git/config [branch "master"] rebase = true
extension in hg Now without merging
Committing git add <file> hg pull -u git commit git
commit -a hg commit git pull git pull git push git push hg push
git stash git merge git stash pop Can add multiple
commits to stash hg shelve extension I don't want to commit everything
Shortcuts: Git and Hg <rev>^ (^<rev> is different) <rev>^ <rev1>..<rev2>
<rev2> - <rev1> (not <rev1>.. <rev2>) :/<some text> desc(<some text>) <ref>@{<a time>} date(<interval>)
git branch === hg bookmark hg branch !== git anything
hg has multiple heads - anonymous branches git detaches the head - must reattach to commit Branching
Both local Can be pushed remotely Can be pulled remotely
Can be named differently Really, your clone is on a local branch Git: Clone ~= Branch
git rebase staging git rebase --onto production staging <feature> git
merge staging git merge --abort git add git commit Merging a Git branch
hg merge staging hg update -C -r HEAD^ hg resolve
hg commit Rebase with extension Merging an Hg branch
Hg - checkout previous version - commit correction as new
head Git - checkout previous version - rewrite history to include correction I made a mistake
Hg - complete history - every merge logged Git -
clean history - linear history History
Why switch to bazaar http://doc.bazaar.canonical. com/migration/en/why-switch-to-bazaar. html#high-storage-efficiency-and-speed Speed
Git style branches hg bookmarks Start rebasing Git stash hg
shelve Recommendations