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
88
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
94
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
Deep Dive into Kotlin Flow
jmatsu
1
370
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
130
スケールする組織の実現に向けた インナーソース育成術 - ISGT2025
teamlab
PRO
2
170
AI Agents: How Do They Work and How to Build Them @ Shift 2025
slobodan
0
100
Cache Me If You Can
ryunen344
2
4k
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
240
個人軟體時代
ethanhuang13
0
330
Rancher と Terraform
fufuhu
2
550
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
510
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
270
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.1k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Facilitating Awesome Meetings
lara
55
6.5k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
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