Re: commit 0? (or: create new empty branch)
Show 13 quoted lines
> I'd like to create a new branch, without any pre-existing data, for
> purposes similar to git's html/man/.....
>
> However, I've been unable to do that using the higher level tools.
>
> Even starting from an empty git rep, I can't create a branch:
>
> $ git init
> Initialized empty Git repository in .git/
> $ git branch empty
> fatal: Not a valid object name: 'master'.
>
> How were the different git.git branches created?
There are two ways:
1. Plumbing level
$ git symbolic-ref HEAD refs/heads/html
$ rm .git/index
...commit new content...
2. Porcelain level
$ mkdir ../html && cd ../html
$ git init
...commit new content...
$ cd - # go back
$ git fetch ../html master:html
-- Hannes