Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to mercurial


Published on

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Introduction to mercurial

  1. 1. Mercurial is not a chemical element. Are you curios what is it?
  2. 2. Who am I?Ivan Ostafiychuk <>,Software EngeenerWorking at SoftServe Inc.
  3. 3. 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)
  4. 4. Getting StartedHow can you get it?● Windows Get it from● Linux Ubuntu: $ apt-get install mercurial Fedora: $ yum install mercurial Gentoo: $ emerge mercurialMac OS X
  5. 5. Start Tour: Initial setup$ cat .hgrc[ui]username = Ivan Ostafiychuk <>
  6. 6. Start Tour: Daily commandsCommand Descriptionhelp <cmd> Built-in help systeminit Create empty repositoryadd Mark files to be added to repository Mark files to be removed fromremove (rm) repositorycommit (ci) Commit your changes to repositorystatus (st) Show your changeshistory (log) Show your changes
  7. 7. 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"
  8. 8. TeamWork: commandsCommand Descriptionclone Make a copy of your repositorypull Pull changes from another repository into yourspull -u Performs the same as pull but also updates working directorypush Push your changes into another repositorymerge Merge working directory with another revision
  9. 9. 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 awesomefeature and we want it NOW$ hg pull -u ../john@my-cool-project$ hg merge && hg ci -m"Synced with John."
  10. 10. TeamWork: Merging
  11. 11. Branching: Clones
  12. 12. Branching: Named branches
  13. 13. Branching: Bookmarks
  14. 14.● Free hosting for Mercurial and Git● Unlimited repositories in terms of size and count● Wiki & Issue Tracker● Support for fork and pull model
  15. 15. Questions
  16. 16. References1. http://mercurial.selenic. com/wiki/HgSubversion