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
97
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
99
Other Decks in Programming
See All in Programming
CSC307 Lecture 14
javiergs
PRO
0
480
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
150
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
400
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.3k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
440
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
160
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
590
Featured
See All Featured
Design in an AI World
tapps
0
170
The Spectacular Lies of Maps
axbom
PRO
1
630
BBQ
matthewcrist
89
10k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
150
Being A Developer After 40
akosma
91
590k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
RailsConf 2023
tenderlove
30
1.4k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
130
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