Difference between revisions of "Mercurial/Getting Started"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (initial commit, so there's no non-existing page)
 
(a checkout is a repository/local commits/no version numbers/command-placeholders)
Line 1: Line 1:
= General hints for using Mercurial =
 
 
This page aims to help cvs/svn users to get started with mercurial, without the need to dig in cyberspace for basic stuff.
 
This page aims to help cvs/svn users to get started with mercurial, without the need to dig in cyberspace for basic stuff.
 
If you have a tip or general remark to share, feel free to edit the page - It's a wiki after all :-)
 
If you have a tip or general remark to share, feel free to edit the page - It's a wiki after all :-)
 +
Especially if you see something wrong here, just correct it without asking for permission on the ML
 +
 +
= The very basics: Mercurial is a DVCS =
 +
Mercurial (hg) is a distributed version control system. This is a major difference compared to tools like CVS or subversion and that difference imposes a changed workflow compared to centralized version control systems.
 +
 +
== Your checkout is a full repository ==
 +
In a simplified view, every checkout is a full repository. You have history and version info for other branches in your local tree. So naturally such a checkout is rather big compared to a single-revision checkout done by cvs and svn. So you won't checkout a full repo every time (unless you have bandwidth to waste and too much time on your hands :-)
 +
Instead you will regularily update your local copy with the changes that were added to the repository and then "clone" (that's the term used for a "checkout") your local repository instead.
 +
 +
== Your commits go to your local repository first ==
 +
Another difference is that any change you commit will be done in your local copy only at first.
 +
You can accumulate many different commits locally and need to "push" changes to the master to finally have them in the main repo/available for everyone.
 +
 +
== There are no version numbers anymore ==
 +
Because multiple persons can do local commits, have different "local master copies" (somebody else could have pushed a change to the master before that alters the file you change yourself), it is impossible to refer to a specific version of a file by a version number. What is version 23 of a file? The one in your local copy, that doesn't exist on the master yet? Or version 23 of a file of another user that did commit the same file locally?
 +
So instead of version numbers, specific versions are refered to using "changeset" identifiers. Think of it as checksums.
 +
 +
= So how to use it then (aka: What commands do I have to type?) =
 +
== creating a local copy ==
 +
== updating the local copy with new changes from the master ==
 +
== cloning from the local repo to create a working copy ==
 +
== show me the differences ==
 +
== committing stuff ==
 +
=== pushing changes ===
 +
== what about merging ==

Revision as of 11:49, 8 May 2009

This page aims to help cvs/svn users to get started with mercurial, without the need to dig in cyberspace for basic stuff. If you have a tip or general remark to share, feel free to edit the page - It's a wiki after all :-) Especially if you see something wrong here, just correct it without asking for permission on the ML

The very basics: Mercurial is a DVCS

Mercurial (hg) is a distributed version control system. This is a major difference compared to tools like CVS or subversion and that difference imposes a changed workflow compared to centralized version control systems.

Your checkout is a full repository

In a simplified view, every checkout is a full repository. You have history and version info for other branches in your local tree. So naturally such a checkout is rather big compared to a single-revision checkout done by cvs and svn. So you won't checkout a full repo every time (unless you have bandwidth to waste and too much time on your hands :-) Instead you will regularily update your local copy with the changes that were added to the repository and then "clone" (that's the term used for a "checkout") your local repository instead.

Your commits go to your local repository first

Another difference is that any change you commit will be done in your local copy only at first. You can accumulate many different commits locally and need to "push" changes to the master to finally have them in the main repo/available for everyone.

There are no version numbers anymore

Because multiple persons can do local commits, have different "local master copies" (somebody else could have pushed a change to the master before that alters the file you change yourself), it is impossible to refer to a specific version of a file by a version number. What is version 23 of a file? The one in your local copy, that doesn't exist on the master yet? Or version 23 of a file of another user that did commit the same file locally? So instead of version numbers, specific versions are refered to using "changeset" identifiers. Think of it as checksums.

So how to use it then (aka: What commands do I have to type?)

creating a local copy

updating the local copy with new changes from the master

cloning from the local repo to create a working copy

show me the differences

committing stuff

pushing changes

what about merging

Personal tools