Push secret changesets

前端 未结 6 1227
孤独总比滥情好
孤独总比滥情好 2021-02-13 18:52

That may look paradoxical, I know that secret changesets are meant to be private, but what if I want to backup those secret changesets?

I work with some branches in para

6条回答
  •  不知归路
    2021-02-13 19:15

    The best approach is a combination of @mischab1's answer, @mark-tolonen's answer and aliases.

    By following mischab1's answer, you make sure that pushing to your backup location will not change the phase to "public".

    Second step would be to add the backup location to your repository's hgrc/paths:

    [paths]
    default = ...
    backup = backup_location
    

    The next step is to define a backup command via alias in the global hgrc, e.g. "bubr" (for backup current branch) or "burev" (backup current rev).

    [alias]
    bubr = push -b . backup
    burev = push -r . backup
    

    hg bubr or hg burev will then push the current branch/revision to the location defined as "backup" path.

    Edit This still has the drawback that you could accidentally push all changes with "hg push" so defining also an hg pubr command to push the current branch and not using "hg push" per default might be helpful.

提交回复
热议问题