Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Quick Project Sharing With hg Over ssh

DZone's Guide to

Quick Project Sharing With hg Over ssh

· DevOps Zone
Free Resource

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

Mercurial is an awesome source control system! If you got a project in your PC and would like to share with your team. An easy and practical way is to put it in a common server (eg: linux) with ssh enabled.

1. Copy your existing project source into your server $HOME/repo/myproject
2. ssh into your server and cd into $HOME/repo/myproject
3. Run # hg init && hg commit -m 'Init added'
5. Exit your server and get your project in your PC terminal and run:
# hg clone ssh://user_id@myserver/repo/myproject

That's it. You don't even need a web server to host it! Just tell all your teammates to do the last step on their own PC terminal. Now eveyone can make changes to your project then commit and push or pull!

TIPS: If you do not place your "repo/myproject" directory under your $HOME, then you would need the double slashes when cloning! For example:
# hg clone ssh://user_id@myserver//usr/local/repo/myproject



The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:

Published at DZone with permission of Zemian Deng, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}