Re: commit 0? (or: create new empty branch)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luciano Rocha schrieb:
> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux