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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
David Newell
March 22, 2013
Programming
100
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git and Hg
A comparison of commands and concepts in git and hg
David Newell
March 22, 2013
More Decks by David Newell
See All by David Newell
CoffeeScript Intro
rustedgrail
2
100
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
990
Agentic UI
manfredsteyer
PRO
0
180
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7.2k
ふつうのFeature Flag実践入門
irof
8
4.1k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
210
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
160
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
120
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
270
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
210
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
AI 輔助遺留系統現代化的經驗分享
jame2408
1
900
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
980
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
RailsConf 2023
tenderlove
30
1.5k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Navigating Team Friction
lara
192
16k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
600
Evolving SEO for Evolving Search Engines
ryanjones
0
220
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
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