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
77
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
90
Other Decks in Programming
See All in Programming
ReactNativeでスケジュール帳を作っている話
mokoshi
0
180
Navigating Generative AI: A Developer's Guide
alperhankendi
0
220
DevTools と デバッグ と 私
kozy4324
1
640
Spring Bootと行レベルセキュリティではじめるマルチテナントアーキテクチャ / Multi-tenant architecture using Row-Level Security
jaguar_imo
1
450
Strategien, Taktiken und Muster der Legacy-Ablösung
tobiaslvoss
0
120
『改訂新版前処理大全』の話と Apache Parquet の話 #TokyoR
bob3bob3
0
170
Androidアプリのテスト駆動開発入門
tonionagauzzi
0
120
Why Spring Matters to Jakarta EE - And Vice Versa
ivargrimstad
0
1.2k
RustのReturn-position impl trait in trait (RPITIT) の実装を雑に見てみる
tako8ki
1
130
コンテナと文字列の中間インタフェースspanとstring_view
faithandbrave
1
120
チームで運用する golangci-lint の向き合い方
sgash708
0
170
Crafting Elegant Symfony Tests
kbond
1
210
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
10
3.6k
Building an army of robots
kneath
300
42k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
Faster Mobile Websites
deanohume
300
30k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6.2k
Visualization
eitanlees
137
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
18
2.8k
Navigating Team Friction
lara
180
13k
The Cost Of JavaScript in 2023
addyosmani
24
4.1k
Debugging Ruby Performance
tmm1
70
11k
The Power of CSS Pseudo Elements
geoffreycrofte
63
5.1k
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