Download - Mercurial: Beginners (v1)
MERCURIAL
(HG)
How 2 letters will solve all your problems
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?
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
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
WORKFLOW:
NOMAD
DEVELOPER
A single developer that works from multiple locations.
Remote Repository
Working CopyDesktop
Working CopyLaptop
Index Index
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
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