Mercurial Equivalent Flow of Git Orphan

Gregory Szorc gregory.szorc at gmail.com
Sun Jul 17 05:38:21 UTC 2016



> On Jul 16, 2016, at 22:14, Sayth Renshaw <flebber.crue at gmail.com> wrote:
> 
> Hi
> 
> I am wanting to use pelican with bitbucket and aerobatic. In a blog post they describe the process of creating the output as an Orphan https://www.aerobatic.com/blog/hugo-continuous-integration-with-wercker-aerobatic-and-bitbucket
> 
> I want to be able to do tis so that my generated output goes into the orphaned branch and then aerobatic will handle serving it.
> 
> This is how the git flow is described.
> 
> # Create a new orphan branch (no commit history) named public
> git checkout --orphan public
> 
> # Unstage all files
> git rm --cached $(git ls-files)
> 
> # Grab one file from the master branch so we can make a commit
> git checkout master README.md
> 
> # Add and commit that file
> git add README.md
> git commit -m "INIT: initial commit on public branch"
> 
> # Push to remote public branch
> git push origin public

What's happening here is you are creating a separate "root" commit in the repo (typically all commits chain up to a single root commit) and therefore a separate DAG within the same repo. Essentially you have multiple, unrelated histories using the same repo store.

In Mercurial, you can do this by running:

$ hg up null
$ hg add <file>
$ hg commit

Personally, at the point you are creating a new root, I'd just create a new repo. But if the tools want multiple roots...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20160716/4154f25e/attachment-0002.html>


More information about the Mercurial mailing list