git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: "J. Bakshi" <joydeep@infoservices.in>
Cc: git@vger.kernel.org
Subject: Re: git with detached worktrees , push has no effect
Date: Fri, 15 Jul 2011 21:24:59 +0200	[thread overview]
Message-ID: <1310757899.7308.10.camel@centaur.lab.cmartin.tk> (raw)
In-Reply-To: <20110715105640.694fb3ea@shiva.selfip.org>

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

On Fri, 2011-07-15 at 10:56 +0530, J. Bakshi wrote:
[snip]
> Working like a charm and the hook is also working fine. Can we make the 
> empty master branch at the server, so that client can continue with
> plain "git push" ?

You may have figured this out already, but once you push, that branch
exists, so under those same rules, pushing to master will work from
there onwards.

If you were asking whether you can create an empty branch on the remote
you it works "automatically", then the answer is no, because a branch
doesn't exist[0] before its first commit. A branch is a reference to a
commit (which is, logically, considered the tip of that branch). Thus an
empty branch cannot exist before any commits are made to that branch.

[0] For the purposes of network transfer. The way to create the first
commit ever in a repo (or in an orphan branch) is to have HEAD point to
an as-of-yet nonexistent branch; but this won't help you in this case.

Cheers,
   cmn


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

      reply	other threads:[~2011-07-15 19:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 12:40 git with detached worktrees , push has no effect J. Bakshi
2011-07-14 12:49 ` Carlos Martín Nieto
2011-07-15  5:25   ` J. Bakshi
2011-07-15  5:26   ` J. Bakshi
2011-07-15 19:24     ` Carlos Martín Nieto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310757899.7308.10.camel@centaur.lab.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=joydeep@infoservices.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).