git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git with detached worktrees , push has no effect

From
JBJ. Bakshi <joydeep@infoservices.in>
Date
Jul 15, 2011, 05:26 UTC
Message-ID
<20110715105640.694fb3ea@shiva.selfip.org>
In-Reply-To
<1310647767.6041.73.camel@centaur.lab.cmartin.tk>

On Thu, 14 Jul 2011 14:49:27 +0200 Carlos Martín Nieto <cmn@elego.de> wrote:

Show 32 quoted lines
> On Thu, 2011-07-14 at 18:10 +0530, J. Bakshi wrote:
> [...] snip snip snip
> > warning: You appear to have cloned an empty repository.
> > 
> >  touch A
> >  git add A
> > 
> >  git commit -m "add A"
> > 
> > [master (root-commit) 7662edd] add A
> >  0 files changed, 0 insertions(+), 0 deletions(-)
> >  create mode 100644 A
> > 
> >  git push
> >  Username:
> >  Password:
> >  Everything up-to-date
> > 
> > 
> > Why reports  [Everything up-to-date] rather than modify the remote git ?
> 
> That's because your remote repository has no branches and per default
> git-push will only push matching branches; as no branches match, there
> is nothing to do. This is what "warning: You appear to have cloned an
> empty repository." is trying to tell you (the message could certainly be
> made much more friendly). Your master branch in this case doesn't exist
> in the server, so you have to tell git to push it explicitly.
> 
>     git push origin master
> 
> will do the trick.
> 
Great !!

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" ?

Thanks
Previous: J. BakshiNext: Carlos Martín Nieto
Message 4 of 5 in “git with detached worktrees , push has no effect”
  1. J. BakshiJul 14, 2011
  2. Carlos Martín NietoJul 14, 2011
  3. J. BakshiJul 15, 2011
  4. J. BakshiJul 15, 2011
  5. Carlos Martín NietoJul 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.