SlideShare a Scribd company logo
Git vs. Mercurial




Marian Marinov
System Architect at Siteground.com
Git vs. Mercurial
Git vs. Mercurial
Git vs. Mercurial
1. Evolution of revision control systems
* RCS -> CVS -> SVN
* Single repository for the history
* Working copy of a file
* Only one developer can commit at a time
* Complicated merges


   RCS/CVS/SVN ARE YOUR
              ENEMY
2. Distributed version control systems(DVCS)
 * Locally accessible history
 * Every developer can commit at will
 * Every client can become a server (no single
server required)
 * Seamless merges
3. Basic repository models
 * Shared repository       Top repository


    clone 1


                  clone 2
                                                clone 4
                                clone 3


* Distributed repository                   Repository
                             Repository
   Repository
                                               Repository
                            Repository

              Repository                  Repository

* Access polices
Centralized Workflow
                           shared
                         repository




           developer




             developer



                         developer
Integration-Manager Workflow
         Project's     Developer    Developer   Developer
        repository      public       public      public




Integration
 manager




                     Developer     Developer    Developer
                      private       private      private
Dictator Workflow

                                                       kernel.org

                                  Sub tree
                                 maintainer

                 Sub tree
                maintainer
 Sub tree
maintainer


                                                               developer



                                                   developer
                                       developer
             developer    developer
developer
Dictator Workflow

                                                       kernel.org

                                  Sub tree
                                 maintainer

                 Sub tree
                maintainer
 Sub tree
maintainer


                                                               developer



                                                   developer
                                       developer
             developer    developer
developer
4. Basic work
  * init
  * add
  * commit
  * mv / rename
  * rm vs. remove
  * log
  * diff
  * grep
  * clone
  * push
  * pull
  * branch & checkout
  * blame vs. annotate
Basic performance info
init
[root@Beast git]# time git init
Initialized empty Git repository in .git/

real 0m0.129s
user 0m0.000s
sys  0m0.000s

[root@Beast hg]# time hg init

real 0m0.204s
user 0m0.020s
sys   0m0.010s
[root@Beast hg]#
add
[root@Beast git]# time git add file0

real 0m0.016s
user 0m0.000s
sys  0m0.000s

[root@Beast hg]# time hg add file0

real 0m0.098s
user 0m0.030s
sys  0m0.010s
Git vs. Mercurial
status
[root@Beast git]# time git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be
committed)
#
#      file0
nothing added to commit but untracked files present
(use "git add" to track)

real 0m0.034s
user 0m0.000s
sys  0m0.000s
status


[root@Beast hg]# time hg status
? file0

real   0m0.028s
user   0m0.010s
sys    0m0.010s
commit

[root@Beast git]# time git commit -m
'added file0' file0
Created initial commit 43bb00d: added file0
 1 files changed, 1 insertions(+), 0
deletions(-)
 create mode 100644 file0

real 0m0.047s
user 0m0.000s
sys  0m0.000s
commit


[root@Beast hg]# time hg commit -m
'added file0' file0
No username found, using
'root@Beast.yuhu.biz' instead

real 0m0.218s
user 0m0.030s
sys  0m0.000s
Git vs. Mercurial
status


[root@Beast hg]# hg status

[root@Beast git]# git status
# On branch master
nothing to commit (working directory clean)
move
move
[root@Beast git]# git mv file0 file1
[root@Beast git]# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to
unstage)
#
#       renamed: file0 -> file1
#
[root@Beast git]# git commit -m 'renamed
file0' file1
Created commit 077d7a3: renamed file0
 1 files changed, 1 insertions(+), 0
deletions(-)
 create mode 100644 file1
move

[root@Beast git]# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
#       deleted: file0
#
[root@Beast git]# git commit -m 'removed
file0' file0
Created commit dfa8fb4: removed file0
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 file0
move

[root@Beast hg]# hg rename file0 file1
[root@Beast hg]# hg status
A file1
R file0
[root@Beast hg]# hg commit -m 'renamed
file0 to file1' file1
[root@Beast hg]# hg status
R file0
[root@Beast hg]# hg commit -m 'removed
file0' file0
[root@Beast hg]# hg status
rm
rm


[root@Beast hg]# hg remove new1
[root@Beast hg]# hg status
R new1
[root@Beast hg]# hg commit -m
'removed new1' new1
[root@Beast hg]# hg status
[root@Beast hg]#
[root@Beast git]# git rm file1
rm 'file1'
[root@Beast git]# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
#       deleted: file1
#
[root@Beast git]# git commit -m 'rm file1' file1
Created commit d47d595: removed file1
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 file1
[root@Beast git]# git status
# On branch master
nothing to commit (working directory clean)
LOG
$ hg l og
changeset :
t ag:
                     4: 2278160e78d4
                     ti p
                                                  the hg way
user :               Br yan O' Sul l i van <  bos@ pent i ne. com
                                                  ser               >
dat e:               Sat Aug 16 22: 16: 53 2008 +      0200
sum ar y:
     m               Tr i m com ent s.
                                m
changeset :          3: 0272e0d5a517
user :               Br yan O' Sul l i van <  bos@ pent i ne. com
                                                  ser               >
dat e:               Sat Aug 16 22: 08: 02 2008 +      0200
sum ar y:
     m               Get m   ake t o gener at e t he f i nal bi nar y
f r om a . o f i   l e.
changeset :          2: f ef 857204a0c
user :               Br yan O' Sul l i van <  bos@ pent i ne. com
                                                  ser               >
dat e:               Sat Aug 16 22: 05: 04 2008 +      0200
sum ar y:
     m               I nt r oduce a t ypo i nt o hel l o. c.
changeset :          1: 82e55d328c8c
user :               m @ eni c. com
                       pm sel
dat e:               Fr i Aug 26 01: 21: 28 2005 - 0700
sum ar y:
     m               Cr eat e a m  akef i l e
changeset :          0: 0a04b987be5a
user :               m @ eni c. com
                       pm sel
dat e:               Fr i Aug 26 01: 20: 50 2005 - 0700
sum ar y:
     m               Cr eat e a st andar d " hel l o, w l d" pr ogr am
                                                         or
the hg way
$ hg log -r 3
changeset:    3:0272e0d5a517
user:        Bryan O'Sullivan <bos@serpentine.com>
date:        Sat Aug 16 22:08:02 2008 +0200
summary:      Get make to generate the final binary from a .o file.

$ hg log -r 0272e0d5a517
changeset:    3:0272e0d5a517
user:        Bryan O'Sullivan <bos@serpentine.com>
date:        Sat Aug 16 22:08:02 2008 +0200
summary:      Get make to generate the final binary from a .o file.

$ hg log -r 1 -r 4
$ hg log -r 2:4
$ hg log -v -p -r 2
$ gi t l og                         the git way
com i t ca82a6df f 817ec66f 44342007202690a93763949
   m
Aut hor : Scot t Chacon < schacon@ gee- m l . com
                                         ai      >
Dat e:    Mon M ar 17 21: 52: 11 2008 - 0700

    changed t he ver si on number

com i t 085bb3bcb608e1e8451d4b2432f 8ecbe6306e7e7
    m
Aut hor : Scot t Chacon < schacon@ gee- m l . com
                                         ai      >
Dat e:    Sat M ar 15 16: 40: 33 2008 - 0700

    r emoved unnecessar y t est code

com i t a11bef 06a3f 659402f e7563abf 99ad00de2209e6
    m
Aut hor : Scot t Chacon < schacon@ gee- m l . com
                                         ai      >
Dat e:    Sat M ar 15 10: 31: 28 2008 - 0700

    f i r st com i t
                m
$ gi t l og   m er ~
               ast  2
$ gi t l og   m er ~ . m er ~
               ast  2. ast   4
$ gi t l og   m er ^ 1 = gi t l og
               ast  1^  =
m er ~
 ast     2
$ gi t l og   m er ^
                ast      2
$ gi t l og   -p
$ gi t l og   – si nce= w2. eeks
$ gi t l og   - - col or           the git way
diff
[ r oot @Beast gi t ] # cat f i l e1
l i ne1
[ r oot @Beast gi t ] # echo ' l i ne2' >>
f i l e1
[ r oot @Beast gi t ] # gi t di f f
di f f - - gi t a/ f i l e1 b/ f i l e1
i ndex a29bdeb. . c0d0f b4 100644
- - - a/ f i l e1
+ + b/ f i l e1
  +
@ -1 + 2 @
  @        1,     @
  l i ne1
+ i ne2
  l
[ r oot @Beast hg] # cat f i l e1
l i ne1
[ r oot @Beast hg] # echo ' l i ne2' >>
f i l e1
[ r oot @Beast hg] # hg di f f
di f f - r d2cf a0a39f b6 f i l e1
- - - a/ f i l e1   Sun Apr 25 05: 32: 01
2010 +   0300
+ + b/ f i l e1
  +                 Sun Apr 25 05: 32: 19
2010 +   0300
@ - 1, 1 + 2 @
  @            1, @
  l i ne1
+ i ne2
  l
grep

* search only the project
* search trough the working copy

[ r oot @ Beast hg] # hg gr ep l i ne
f i l e1: 6: l i ne1

[ r oot @ Beast gi t ] # gi t gr ep l i ne
f i l e1: l i ne1
f i l e1: l i ne2
Git vs. Mercurial
$   gi t   cl one   di r
$   gi t   cl one   gi t : / / host / di r
$   gi t   cl one   ht t p( s) : / / host / di r
$   gi t   cl one   r sync: / / [ user @ host / di r
                                           ]
$   gi t   cl one   ssh: / / [ user @  host ] / di r

ssh onl y: gi t cl one [ user @ host : di r
                               ]
$ hg cl one ht t p: / / host / di r
$ hg cl one ssh: / / [ user @ host / di r
                               ]
pull
Pulling changes


Git pull
* combined fetch + merge

HG pull
* only fetch
* -U for fetch + merge
push
Pushing changes




$ gi t push [ or i gi n] [ m er ]
                            ast

$ hg push [ dest i nat i on]
branching
branching

GIT
HEAD –    poi nt s t o t he most r ecent
com i t
    m     i n t he cur r ent br anch
m er
 ast      – a speci al nam br anch
                             ed

Mercurial
t i p – poi nt s t o t he most r ecent
com i t
     m
H ead – i s t he t i p or t he t i ps of
m gi ng br anches
  er
branching

GIT
$ gi t br anch br anch_ name
$ gi t checkout br anch_ nam e

Mercurial
$ hg br anch br anch_ name
$ hg updat e br anch_ name
tags vs. branches
* Tags i n m cur i al ar e synonym t o
               er                   s
a changeset
* Tags i n m cur i al ar e ver si on
               er
cont r ol l ed
* Tags i n gi t ar e onl y a sym i nk t o
                                  l
a com i t
       m
* Tags i n gi t ar e onl y l ocal

* Br anches i n bot h ar e used f or
cont i nues devel opment
Няма значение за какво става въпрос...
Той е виновен!
Blame / annotate
$ hg annot at e - u - d - c - l mysql
f l or i an 07b950dc7279 Tue    M ar   02   . . . : 1:   # / bi n/ sh
                                                          !
beekhof 67234f 982ab7 Thu       J ul   05   . . . : 2:   #
f l or i an 01a181a4165c Fr i   Apr    02   . . . : 3:   #
beekhof 67234f 982ab7 Thu       J ul   05   . . . : 4:   #M LySQ
beekhof 67234f 982ab7 Thu       J ul   05   . . . : 5:   #
beekhof 67234f 982ab7 Thu       J ul   05   . . . : 6:   #D  escr i pt i on:
M anages a M L ySQ
beekhof 67234f 982ab7 Thu       J ul 05 . . . : 8:       #
f l or i an 380982a15dc8 Fr i   Apr 23 . . . : 8:        # Aut hor s:          Al an
Rober t son:
f l or i an 380982a15dc8 Fr i   Apr 23 . . . : 9:        #                     J akub
J anczak:
f l or i an 380982a15dc8 Fr i   Apr 23 . . . : 10: #                           Andr ew
Beekhof :
f l or i an 380982a15dc8 Fr i   Apr 23 . . . : 11: #
Sebast i an Rei t enbach:
$ gi t bl am haw pl
             e   k.
^0e22116 ( r oot 2008- 07- 09   ...    1)   # / usr / bi n/ per l - T
                                             !
a5062333 ( val 2009- 06- 10     ...    2)
^0e22116 ( r oot 2008- 07- 09   ...    3)   use st r i ct ;
^0e22116 ( r oot 2008- 07- 09   ...    4)   use w ni ngs;
                                                 ar
37f b4989 ( val 2009- 06- 01    ...    5)
a5062333 ( val 2009- 06- 10     ...    6)   use D : : m
                                                 BD    ysql ;
a5062333 ( val 2009- 06- 10     ...    7)   use PO X qw set si d) ,
                                                  SI     (
qw W O AN ) ;
  ( NH G
..........
a5062333 ( val 2009- 06- 10     ...   12)   i m t par se_ conf i g;
                                               por
6ad3f f 60 ( val 2009- 06- 19   ...   13)   i m t post _ a_ not e;
                                               por
^0e22116 ( r oot 2008- 07- 09   ...   14)
^0e22116 ( r oot 2008- 07- 09   ...   15)   # syst em var i abl es
^0e22116 ( r oot 2008- 07- 09   ...   16)   $ENV{PATH = ' ' ;
                                                      }
7868b7e1 ( val 2010- 04- 23     ...   17)   m $VERSI O = ' 2. 1. 0' ;
                                             y         N
^0e22116 ( r oot 2008- 07- 09   ...   18)
^0e22116 ( r oot 2008- 07- 09   ...   19)   # def i ni ng f aul t hashes

$ gi t bl am - L 16, 18 haw pl
            e                 k.
$ gi t bl am - L / use st r i ct / , / use D / haw pl
            e                               BD    k.
books
books


Mercurial
* http://hgbook.red-bean.com/read/

Git
* http://book.git-scm.com/
* http://progit.org/book/
E-mail: mm@yuhu.biz
Jabber: hackman@jabber.org




             Thank you!




Marian Marinov
System Architect at Siteground.com
Ad

More Related Content

What's hot (20)

Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenTraining: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
Artur Ventura
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Intro To Git
Intro To GitIntro To Git
Intro To Git
kyleburton
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
Md. Main Uddin Rony
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
Zeeshan Khan
 
Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
Daniel Wieth
 
Git hub_pptx
Git hub_pptxGit hub_pptx
Git hub_pptx
PathanNadhiyaSulthan
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Together
tmatesoftware
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
NETWAYS
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentation
AyanaRukasar
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
brendandburns
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Imesh Gunaratne
 
Branch Management in Git Fusion
Branch Management in Git FusionBranch Management in Git Fusion
Branch Management in Git Fusion
Perforce
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
Simon Su
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)
Arkadiusz Borek
 
OSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
OSDC 2018 | Monitoring Kubernetes at Scale by Monica SarbuOSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
OSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
NETWAYS
 
Advanced Git - Functionality and Features
Advanced Git - Functionality and FeaturesAdvanced Git - Functionality and Features
Advanced Git - Functionality and Features
All Things Open
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenTraining: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
Artur Ventura
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
Zeeshan Khan
 
Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
Daniel Wieth
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Together
tmatesoftware
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
NETWAYS
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentation
AyanaRukasar
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
brendandburns
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Imesh Gunaratne
 
Branch Management in Git Fusion
Branch Management in Git FusionBranch Management in Git Fusion
Branch Management in Git Fusion
Perforce
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
Simon Su
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)
Arkadiusz Borek
 
OSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
OSDC 2018 | Monitoring Kubernetes at Scale by Monica SarbuOSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
OSDC 2018 | Monitoring Kubernetes at Scale by Monica Sarbu
NETWAYS
 
Advanced Git - Functionality and Features
Advanced Git - Functionality and FeaturesAdvanced Git - Functionality and Features
Advanced Git - Functionality and Features
All Things Open
 

Similar to Git vs. Mercurial (20)

分布式版本管理
分布式版本管理分布式版本管理
分布式版本管理
jeffz
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroduction
Bruno Bossola
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
Celestine Omin
 
3 Git
3 Git3 Git
3 Git
Fabio Fumarola
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
atishgoswami
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
Javier Lafora Rey
 
Approximating Change Sets at Philips Healthcare: A Case Study
Approximating Change Sets at Philips Healthcare: A Case StudyApproximating Change Sets at Philips Healthcare: A Case Study
Approximating Change Sets at Philips Healthcare: A Case Study
Rahul Premraj
 
Loading...git
Loading...gitLoading...git
Loading...git
Rafael García
 
Working with Git
Working with GitWorking with Git
Working with Git
Pete Nicholls
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)
SeongJae Park
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Aleksey Asiutin
 
vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29
CloudStack - Open Source Cloud Computing Project
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Git presentation
Git presentationGit presentation
Git presentation
Lorenzo Baracchi
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
chenghlee
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
Automat-IT
 
分布式版本管理
分布式版本管理分布式版本管理
分布式版本管理
jeffz
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroduction
Bruno Bossola
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
Celestine Omin
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
atishgoswami
 
Approximating Change Sets at Philips Healthcare: A Case Study
Approximating Change Sets at Philips Healthcare: A Case StudyApproximating Change Sets at Philips Healthcare: A Case Study
Approximating Change Sets at Philips Healthcare: A Case Study
Rahul Premraj
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)
SeongJae Park
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
chenghlee
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
Automat-IT
 
Ad

More from Marian Marinov (20)

How to start and then move forward in IT
How to start and then move forward in ITHow to start and then move forward in IT
How to start and then move forward in IT
Marian Marinov
 
Thinking about highly-available systems and their setup
Thinking about highly-available systems and their setupThinking about highly-available systems and their setup
Thinking about highly-available systems and their setup
Marian Marinov
 
Understanding your memory usage under Linux
Understanding your memory usage under LinuxUnderstanding your memory usage under Linux
Understanding your memory usage under Linux
Marian Marinov
 
How to implement PassKeys in your application
How to implement PassKeys in your applicationHow to implement PassKeys in your application
How to implement PassKeys in your application
Marian Marinov
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
Marian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
Marian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
Marian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Marian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
Marian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
Marian Marinov
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
Marian Marinov
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
Marian Marinov
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
Marian Marinov
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
Marian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
Marian Marinov
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
Marian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
Marian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
Marian Marinov
 
How to start and then move forward in IT
How to start and then move forward in ITHow to start and then move forward in IT
How to start and then move forward in IT
Marian Marinov
 
Thinking about highly-available systems and their setup
Thinking about highly-available systems and their setupThinking about highly-available systems and their setup
Thinking about highly-available systems and their setup
Marian Marinov
 
Understanding your memory usage under Linux
Understanding your memory usage under LinuxUnderstanding your memory usage under Linux
Understanding your memory usage under Linux
Marian Marinov
 
How to implement PassKeys in your application
How to implement PassKeys in your applicationHow to implement PassKeys in your application
How to implement PassKeys in your application
Marian Marinov
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
Marian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
Marian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
Marian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Marian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
Marian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
Marian Marinov
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
Marian Marinov
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
Marian Marinov
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
Marian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
Marian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
Marian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
Marian Marinov
 
Ad

Recently uploaded (20)

Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 

Git vs. Mercurial

  • 1. Git vs. Mercurial Marian Marinov System Architect at Siteground.com
  • 5. 1. Evolution of revision control systems * RCS -> CVS -> SVN * Single repository for the history * Working copy of a file * Only one developer can commit at a time * Complicated merges RCS/CVS/SVN ARE YOUR ENEMY
  • 6. 2. Distributed version control systems(DVCS) * Locally accessible history * Every developer can commit at will * Every client can become a server (no single server required) * Seamless merges
  • 7. 3. Basic repository models * Shared repository Top repository clone 1 clone 2 clone 4 clone 3 * Distributed repository Repository Repository Repository Repository Repository Repository Repository * Access polices
  • 8. Centralized Workflow shared repository developer developer developer
  • 9. Integration-Manager Workflow Project's Developer Developer Developer repository public public public Integration manager Developer Developer Developer private private private
  • 10. Dictator Workflow kernel.org Sub tree maintainer Sub tree maintainer Sub tree maintainer developer developer developer developer developer developer
  • 11. Dictator Workflow kernel.org Sub tree maintainer Sub tree maintainer Sub tree maintainer developer developer developer developer developer developer
  • 12. 4. Basic work * init * add * commit * mv / rename * rm vs. remove * log * diff * grep * clone * push * pull * branch & checkout * blame vs. annotate
  • 14. init [root@Beast git]# time git init Initialized empty Git repository in .git/ real 0m0.129s user 0m0.000s sys 0m0.000s [root@Beast hg]# time hg init real 0m0.204s user 0m0.020s sys 0m0.010s [root@Beast hg]#
  • 15. add [root@Beast git]# time git add file0 real 0m0.016s user 0m0.000s sys 0m0.000s [root@Beast hg]# time hg add file0 real 0m0.098s user 0m0.030s sys 0m0.010s
  • 17. status [root@Beast git]# time git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # file0 nothing added to commit but untracked files present (use "git add" to track) real 0m0.034s user 0m0.000s sys 0m0.000s
  • 18. status [root@Beast hg]# time hg status ? file0 real 0m0.028s user 0m0.010s sys 0m0.010s
  • 19. commit [root@Beast git]# time git commit -m 'added file0' file0 Created initial commit 43bb00d: added file0 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 file0 real 0m0.047s user 0m0.000s sys 0m0.000s
  • 20. commit [root@Beast hg]# time hg commit -m 'added file0' file0 No username found, using '[email protected]' instead real 0m0.218s user 0m0.030s sys 0m0.000s
  • 22. status [root@Beast hg]# hg status [root@Beast git]# git status # On branch master nothing to commit (working directory clean)
  • 23. move
  • 24. move [root@Beast git]# git mv file0 file1 [root@Beast git]# git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # renamed: file0 -> file1 # [root@Beast git]# git commit -m 'renamed file0' file1 Created commit 077d7a3: renamed file0 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 file1
  • 25. move [root@Beast git]# git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: file0 # [root@Beast git]# git commit -m 'removed file0' file0 Created commit dfa8fb4: removed file0 1 files changed, 0 insertions(+), 1 deletions(-) delete mode 100644 file0
  • 26. move [root@Beast hg]# hg rename file0 file1 [root@Beast hg]# hg status A file1 R file0 [root@Beast hg]# hg commit -m 'renamed file0 to file1' file1 [root@Beast hg]# hg status R file0 [root@Beast hg]# hg commit -m 'removed file0' file0 [root@Beast hg]# hg status
  • 27. rm
  • 28. rm [root@Beast hg]# hg remove new1 [root@Beast hg]# hg status R new1 [root@Beast hg]# hg commit -m 'removed new1' new1 [root@Beast hg]# hg status [root@Beast hg]#
  • 29. [root@Beast git]# git rm file1 rm 'file1' [root@Beast git]# git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: file1 # [root@Beast git]# git commit -m 'rm file1' file1 Created commit d47d595: removed file1 1 files changed, 0 insertions(+), 1 deletions(-) delete mode 100644 file1 [root@Beast git]# git status # On branch master nothing to commit (working directory clean)
  • 30. LOG
  • 31. $ hg l og changeset : t ag: 4: 2278160e78d4 ti p the hg way user : Br yan O' Sul l i van < bos@ pent i ne. com ser > dat e: Sat Aug 16 22: 16: 53 2008 + 0200 sum ar y: m Tr i m com ent s. m changeset : 3: 0272e0d5a517 user : Br yan O' Sul l i van < bos@ pent i ne. com ser > dat e: Sat Aug 16 22: 08: 02 2008 + 0200 sum ar y: m Get m ake t o gener at e t he f i nal bi nar y f r om a . o f i l e. changeset : 2: f ef 857204a0c user : Br yan O' Sul l i van < bos@ pent i ne. com ser > dat e: Sat Aug 16 22: 05: 04 2008 + 0200 sum ar y: m I nt r oduce a t ypo i nt o hel l o. c. changeset : 1: 82e55d328c8c user : m @ eni c. com pm sel dat e: Fr i Aug 26 01: 21: 28 2005 - 0700 sum ar y: m Cr eat e a m akef i l e changeset : 0: 0a04b987be5a user : m @ eni c. com pm sel dat e: Fr i Aug 26 01: 20: 50 2005 - 0700 sum ar y: m Cr eat e a st andar d " hel l o, w l d" pr ogr am or
  • 32. the hg way $ hg log -r 3 changeset: 3:0272e0d5a517 user: Bryan O'Sullivan <[email protected]> date: Sat Aug 16 22:08:02 2008 +0200 summary: Get make to generate the final binary from a .o file. $ hg log -r 0272e0d5a517 changeset: 3:0272e0d5a517 user: Bryan O'Sullivan <[email protected]> date: Sat Aug 16 22:08:02 2008 +0200 summary: Get make to generate the final binary from a .o file. $ hg log -r 1 -r 4 $ hg log -r 2:4 $ hg log -v -p -r 2
  • 33. $ gi t l og the git way com i t ca82a6df f 817ec66f 44342007202690a93763949 m Aut hor : Scot t Chacon < schacon@ gee- m l . com ai > Dat e: Mon M ar 17 21: 52: 11 2008 - 0700 changed t he ver si on number com i t 085bb3bcb608e1e8451d4b2432f 8ecbe6306e7e7 m Aut hor : Scot t Chacon < schacon@ gee- m l . com ai > Dat e: Sat M ar 15 16: 40: 33 2008 - 0700 r emoved unnecessar y t est code com i t a11bef 06a3f 659402f e7563abf 99ad00de2209e6 m Aut hor : Scot t Chacon < schacon@ gee- m l . com ai > Dat e: Sat M ar 15 10: 31: 28 2008 - 0700 f i r st com i t m
  • 34. $ gi t l og m er ~ ast 2 $ gi t l og m er ~ . m er ~ ast 2. ast 4 $ gi t l og m er ^ 1 = gi t l og ast 1^ = m er ~ ast 2 $ gi t l og m er ^ ast 2 $ gi t l og -p $ gi t l og – si nce= w2. eeks $ gi t l og - - col or the git way
  • 35. diff
  • 36. [ r oot @Beast gi t ] # cat f i l e1 l i ne1 [ r oot @Beast gi t ] # echo ' l i ne2' >> f i l e1 [ r oot @Beast gi t ] # gi t di f f di f f - - gi t a/ f i l e1 b/ f i l e1 i ndex a29bdeb. . c0d0f b4 100644 - - - a/ f i l e1 + + b/ f i l e1 + @ -1 + 2 @ @ 1, @ l i ne1 + i ne2 l
  • 37. [ r oot @Beast hg] # cat f i l e1 l i ne1 [ r oot @Beast hg] # echo ' l i ne2' >> f i l e1 [ r oot @Beast hg] # hg di f f di f f - r d2cf a0a39f b6 f i l e1 - - - a/ f i l e1 Sun Apr 25 05: 32: 01 2010 + 0300 + + b/ f i l e1 + Sun Apr 25 05: 32: 19 2010 + 0300 @ - 1, 1 + 2 @ @ 1, @ l i ne1 + i ne2 l
  • 38. grep * search only the project * search trough the working copy [ r oot @ Beast hg] # hg gr ep l i ne f i l e1: 6: l i ne1 [ r oot @ Beast gi t ] # gi t gr ep l i ne f i l e1: l i ne1 f i l e1: l i ne2
  • 40. $ gi t cl one di r $ gi t cl one gi t : / / host / di r $ gi t cl one ht t p( s) : / / host / di r $ gi t cl one r sync: / / [ user @ host / di r ] $ gi t cl one ssh: / / [ user @ host ] / di r ssh onl y: gi t cl one [ user @ host : di r ]
  • 41. $ hg cl one ht t p: / / host / di r $ hg cl one ssh: / / [ user @ host / di r ]
  • 42. pull
  • 43. Pulling changes Git pull * combined fetch + merge HG pull * only fetch * -U for fetch + merge
  • 44. push
  • 45. Pushing changes $ gi t push [ or i gi n] [ m er ] ast $ hg push [ dest i nat i on]
  • 47. branching GIT HEAD – poi nt s t o t he most r ecent com i t m i n t he cur r ent br anch m er ast – a speci al nam br anch ed Mercurial t i p – poi nt s t o t he most r ecent com i t m H ead – i s t he t i p or t he t i ps of m gi ng br anches er
  • 48. branching GIT $ gi t br anch br anch_ name $ gi t checkout br anch_ nam e Mercurial $ hg br anch br anch_ name $ hg updat e br anch_ name
  • 49. tags vs. branches * Tags i n m cur i al ar e synonym t o er s a changeset * Tags i n m cur i al ar e ver si on er cont r ol l ed * Tags i n gi t ar e onl y a sym i nk t o l a com i t m * Tags i n gi t ar e onl y l ocal * Br anches i n bot h ar e used f or cont i nues devel opment
  • 50. Няма значение за какво става въпрос... Той е виновен!
  • 51. Blame / annotate $ hg annot at e - u - d - c - l mysql f l or i an 07b950dc7279 Tue M ar 02 . . . : 1: # / bi n/ sh ! beekhof 67234f 982ab7 Thu J ul 05 . . . : 2: # f l or i an 01a181a4165c Fr i Apr 02 . . . : 3: # beekhof 67234f 982ab7 Thu J ul 05 . . . : 4: #M LySQ beekhof 67234f 982ab7 Thu J ul 05 . . . : 5: # beekhof 67234f 982ab7 Thu J ul 05 . . . : 6: #D escr i pt i on: M anages a M L ySQ beekhof 67234f 982ab7 Thu J ul 05 . . . : 8: # f l or i an 380982a15dc8 Fr i Apr 23 . . . : 8: # Aut hor s: Al an Rober t son: f l or i an 380982a15dc8 Fr i Apr 23 . . . : 9: # J akub J anczak: f l or i an 380982a15dc8 Fr i Apr 23 . . . : 10: # Andr ew Beekhof : f l or i an 380982a15dc8 Fr i Apr 23 . . . : 11: # Sebast i an Rei t enbach:
  • 52. $ gi t bl am haw pl e k. ^0e22116 ( r oot 2008- 07- 09 ... 1) # / usr / bi n/ per l - T ! a5062333 ( val 2009- 06- 10 ... 2) ^0e22116 ( r oot 2008- 07- 09 ... 3) use st r i ct ; ^0e22116 ( r oot 2008- 07- 09 ... 4) use w ni ngs; ar 37f b4989 ( val 2009- 06- 01 ... 5) a5062333 ( val 2009- 06- 10 ... 6) use D : : m BD ysql ; a5062333 ( val 2009- 06- 10 ... 7) use PO X qw set si d) , SI ( qw W O AN ) ; ( NH G .......... a5062333 ( val 2009- 06- 10 ... 12) i m t par se_ conf i g; por 6ad3f f 60 ( val 2009- 06- 19 ... 13) i m t post _ a_ not e; por ^0e22116 ( r oot 2008- 07- 09 ... 14) ^0e22116 ( r oot 2008- 07- 09 ... 15) # syst em var i abl es ^0e22116 ( r oot 2008- 07- 09 ... 16) $ENV{PATH = ' ' ; } 7868b7e1 ( val 2010- 04- 23 ... 17) m $VERSI O = ' 2. 1. 0' ; y N ^0e22116 ( r oot 2008- 07- 09 ... 18) ^0e22116 ( r oot 2008- 07- 09 ... 19) # def i ni ng f aul t hashes $ gi t bl am - L 16, 18 haw pl e k. $ gi t bl am - L / use st r i ct / , / use D / haw pl e BD k.
  • 53. books
  • 55. E-mail: [email protected] Jabber: [email protected] Thank you! Marian Marinov System Architect at Siteground.com