Search code examples
mercurialmercurial-queuemercurial-extension

Mercurial: How can I keep stuff locally only?


We have some restrictions on what we are allowed to put in our central Mercurial repository.

Is there some way I can keep stuff in my local Hg repository, without having it pushed to the central one?

Note:

  1. The files might be connected to files in the central repository (branches for example).
  2. Local stuff might later be incorporated in the central repository.

Solution

  • If you're using branches, you can set their visibility to secret. This will prevent them to be pushed.

    hg phase --secret --force my-branch
    

    When you want to share, you change their phase to draft and then they will be automatically collected during a push operation.

    See hg help phases for more information.