Monday, March 19, 2012

UNIX TOOLs - Version Control with Mercurial (using single-user local repository)

  * Version Control

    + Gives the ability to pull out any version ever created
    + Allows tracking WHO made each change (committer id)
    + Allows tracking WHAT each change was (diffs)
    + Allows tracking WHY each change was made (commit comments)
    + Allows seeing history (log of commits)
    + Less disk space than many backups, easier to use
    + file-based (old school, SCCS, RCS, CVS)
    + FOSS centralized vs. distributed
      * CVS, SVN                     (centralized)
      * git, hg, bzr, mtn, darcs, arch, fossil     (distributed)
    + proprietary names you may know (non-free, closed source)
      * Visual SourceSafe            (single-user)
      * ClearCase, Perforce          (centralized)
      * Bitkeeper                    (distributed)

  * Version Control with Mercurial (using single-user local repository)

    + Home site is http://mercurial.selenic.com/
    + Based on 'changeset' concept with named tag support
    + Example usage for single developer
      * hg init       (initialize)
      * hg add        (add a file to be tracked)
      * hg remove     (stop tracking a file)
      * hg rename     (rename a file, maybe with -A)
      * hg stat       (report current status)
      * hg diff       (see changes between working copy and repository)
        can use -r to specify revisions
      * hg commit     (permanently save changes in repository)
        Must use -u and -m, optionally can specify path list
      * hg tag        (create a tag)
      * hg tags       (display tags)
      * hg log        (show changelog)
      * hg update     (change to revision with -r)
      * hg revert     (for those OOPS! moments...)
      * hg help       (get online help)
      * hg cat -r X f (dump specific version of file f to stdout)
    + backing up repository to USB stick on BLS2
    + backing up repository to another machine with rsync

No comments:

Post a Comment