mercurial: beginners (v1)

7
MERCURIAL (HG) How 2 letters will solve all your problems

Upload: michael-wales

Post on 16-Jul-2015

8.559 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Mercurial: Beginners (v1)

MERCURIAL

(HG)

How 2 letters will solve all your problems

Page 2: Mercurial: Beginners (v1)

YOUR

DEVELOPERS:

TODAY

Who has the database class open? I need to fix a bug!

Okay, I’ll save my changes – you copy/paste yours into Notepad, reload the file, then add

your changes back in.

Okay, the new API is in the API-new directory, I left the old API for legacy stuff until we get it refactored.

Can someone help the new guy get his environment up and running?

I know you’re at home, but can you make the change and email it to me?

Page 3: Mercurial: Beginners (v1)

YOUR

DEVELOPERS:

TOMORROW

hg mergeChanges between multiple developers are

combined – like magic

hg pull / hg updateGet the work others have done, merge it with

what I’ve done

hg branchNew features and massive rewrites can take

place, without affecting other developers

hg cloneThe new guy is ready to go

hg pushChanges are available to anyone else with access

Page 4: Mercurial: Beginners (v1)

VERSION

CONTROL

DEFINITIONS

Remote RepositoryHosted online

Where code is passed between developers

IndexHosted locally

Code that is either incoming/outgoing the

working copy

Working CopyHosted locally

Where the magic happens

hg pull

hg updatehg commit

hg push

Page 5: Mercurial: Beginners (v1)

WORKFLOW:

NOMAD

DEVELOPER

A single developer that works from multiple locations.

Remote Repository

Working CopyDesktop

Working CopyLaptop

Index Index

Page 6: Mercurial: Beginners (v1)

WORKFLOW:

EQUAL

RIGHTS

Every developer has equal rights to push code into the remote repository.

Remote Repository

Working CopyDeveloper A

Working CopyDeveloper B

Working CopyDeveloper C

Index Index Index

Page 7: Mercurial: Beginners (v1)

WORKFLOW:

CODEBASE

OVERLORD

One developer controls the pushes into the project’s remote repository.

(Indexes removed for graphic clarity).

Project Remote Repository

Developer A Developer B Developer C

Remote Repository

Remote Repository

Remote Repository

Codebase Overlord