MacHg icon

Adding a Server Repository

External repositories, when "added" to your MacHg documents, are included just as references. Once you have a server reference in your document, you will then be able to clone (copy) the repository on the server, push (upload) changes from your computer to that server or pull (download) changes from that server to your computer.

To add a server repository (reference):

  1. Choose Repository > "Add Server Repository...", or right-click in the left sidebar and choose "Add Server Repository..."

  2. In the dialog that appears, enter a short name of your choosing to help you identify the external repository. This short name will be used in the left sidebar and in other places to refer to this external repository.

  3. In the dialog that appears, enter the URL for the desired server into the field "Server URL". Here are some examples of standard URLs

    • ssh://


    • https://somehost/somefolder/

  4. In the username field enter the user name for the server

  5. In the password field enter the password for the user and server. (Note for ssh connections you cannot enter a password directly here. See: About Security And Passwords)

  6. You can view the complete URL which MacHg will send to Mercurial in the field 'Full Server URL:'

  7. Once you have entered a shortname and Server URL the connection will be automatically tested. You can click the details button to see the connection attempt. If you are experiencing connection problems you can test the connection directly in the terminal by clicking the button labeled 'Test in Terminal'. This is sometimes useful to diagnose problems.

Important:Any connection you set up needs to be non-interactive. If you are prompted for your password while testing the connection in the terminal then this is an "interactive" login and such a connection will not function with MacHg. If you are using ssh, you need to transfer your public ssh keys onto the server so that authentication is non-interactive, ie a password is never interactively requested each time a connection is established. (You can use passwordless ssh keys or an ssh-agent will do a one time authentication, which is not interactive at the low level.)

Important: Removing a repository just removes the reference to the repository. It doesn't actually move the folder of files to the trash, or remove the repository from the server. However, when deleting a local repository, you are given the option of moving the actual repository (the folder of files on your machine) to the trash. Choose this option with care.

Note:Any password you enter will be stored securely in the system keychain.

Related Topics

About Security And Passwords

About Server Identity Security

About Repository Identities

About The Command Line

External Links

Apple : SSH Keys