Re: Can a git changeset be created with no parent
- From
Carlos Martín Nieto <cmn@elego.de>
- Date
- Sep 25, 2011, 14:33 UTC
- Message-ID
- <1316961212.4388.5.camel@centaur.lab.cmartin.tk>
- In-Reply-To
- <1316960136073-6829212.post@n2.nabble.com>
On Sun, 2011-09-25 at 07:15 -0700, vra5107 wrote:
Show 5 quoted lines
> Hi > > I am currently in the process of converting a large hg repository. > One of the changesets has no parents assigned. So to mirror that is it > possible to create a git changeset that doesnot have a parent ?
They're called commits in git, and yes it's possible. They are called orphan commits and it's what you get when you do the first commit in the repository.
You can do this with 'git checkout --orphan somebranch'. Notice that the index will be kept, you'll need to either use 'git rm' or 'git add -A'.
There is a longer explanation in the manpage for 'git checkout'.
cmn