introduction to mercurial

16
Mercurial is not a chemical element. Are you curios what is it?

Upload: it-booze

Post on 23-Jan-2015

1.010 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Mercurial is not a chemical element.

Are you curios what is it?

Who am I?Ivan Ostafiychuk <[email protected]>,Software EngeenerWorking at SoftServe Inc.

What is a Mercurial?● Distributed Version Control System like Git,

Bazaar and others ● Mercurial was created by Matt Mackall in

April 19, 2005● The latest stable 2.1 is released February 1,

2012 (3 days ago)

Getting StartedHow can you get it?● Windows

Get it from http://tortoisehg.bitbucket.org/● Linux

Ubuntu: $ apt-get install mercurialFedora: $ yum install mercurialGentoo: $ emerge mercurial

Mac OS Xhttp://mercurial.berkwood.com/

Start Tour: Initial setup$ cat .hgrc[ui]username = Ivan Ostafiychuk <[email protected]>

Start Tour: Daily commandsCommand Description

help <cmd> Built-in help system

init Create empty repository

add Mark files to be added to repository

remove (rm) Mark files to be removed from repository

commit (ci) Commit your changes to repository

status (st) Show your changes

history (log) Show your changes

Start Tour: Example$ cd ~$ mkdir my-cool-project$ cd my-cool-project$ vi main.c$ hg add main.c$ hg ci -m "Initial commit."$ vi main.c$ hg ci -m "Refactored a bit"

TeamWork: commandsCommand Description

clone Make a copy of your repository

pull Pull changes from another repository into yours

pull -u Performs the same as pull but also updates working directory

push Push your changes into another repository

merge Merge working directory with another revision

TeamWork: Example$ mv my-cool-project john@my-cool-project$ hg clone john@my-cool-project

bob@my-cool-project$ cd bob@my-cool-project$ # doing our stuf here (e.g. changes, commits)$ # BUT john also developed some awesome feature and we want it NOW$ hg pull -u ../john@my-cool-project$ hg merge && hg ci -m"Synced with John."

TeamWork: Merging

Branching: Clones

Branching: Named branches

Branching: Bookmarks

BitBucket.org● Free hosting for Mercurial and Git● Unlimited repositories in terms of size and

count● Wiki & Issue Tracker● Support for fork and pull model

Questions

References1. http://mercurial.selenic.com/2. https://bitbucket.org/3. http://ilovemercurial.com/4. http://www.fogcreek.com/kiln/5. http://hginit.com/6. http://hgbook.red-bean.com/read/7. http://mercurial.selenic.

com/wiki/HgSubversion