1. Intro
Simple HG notes for working with iarc code using hg.
Installed on my centos 6.4 computer
# yum install hg
2. IARC is the owner of Project. He will create a new Repository
cd project/ - your project's location
hg init - Initialize the repository. But it is empty
hg add * - add all files to repository
hg commit - commit all changes to the repository
Now iarc has a working directory and a repository.
This can modify this working copy.
When iarc is ready to update his repository with a new version:
hg diff - show changes between repository and working copy.
hg commit - commit all changes to the repository
If someone pushes an update to iarc, then iarc need to do:
hg update - updates the repository's working directory
It's likely, others can't update iarc's repository (permission problems), so
iarc can pull those update:
hg pull /home/joe/project - pulls in changes from joe's repository
hg update - update tony's working copy
2. Tony wants to join in.
To get a copy of iarc's repository (not the working copy):
hg clone /home/iarc/project project // copy method (can't push update).
hg clone ssh://iarc@iarc.ifa.hawaii.edu/src/path // ssh method (can push update)
To re-synhonize a working copy (Update Tony's copy with iarc's repository):
hg pull - to sync the repository
hg update - to update the working copy
Tony modify his working directory. Change can be commit
hg commit -u tony
To updload changes to iarc's repository:
hg push
3. Info
hg log - history of repository
hg status - display current status (files that changed).
hg diff - shows changes between repository and working copy.
Cloning & Merging
user1> hg clone /home/iarc/temp/project1 project1
user1> (edit files)
user1> hg commit
user1> hg push
master> hg update tip
References
Charles's has better notes
Mercurial: The Defintive Guide is on the web.