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

Trying to push into empty repo, get fatal: bad revision 'HEAD'

From
SWSamuel Williams <space.ship.traveller@gmail.com>
Date
Mar 31, 2015, 23:29 UTC
Message-ID
<CAHkN8V8cpZUmCi6=MUcsCOCBe6H_G6btr6WaV2vVrO1Nm_r4tg@mail.gmail.com>
I have set up a remote repository like so:

remote $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sharedrepository = 1 worktree = /srv/http/www.site.com [receive] denyNonFastforwards = true denyCurrentBranch = updateInstead

This repo is empty by default.
When I try to push into it, I get the following:
local $ git push --set-upstream production master
Counting objects: 29, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (29/29), 1.13 MiB | 0 bytes/s, done.
Total 29 (delta 3), reused 17 (delta 0)
fatal: bad revision 'HEAD'
To ssh://remote.net/srv/http/www.site.com
 ! [remote rejected] master -> master (Working directory has staged changes)
error: failed to push some refs to 'ssh://remote.net/srv/http/www.site.com'
Is this expected? Am I doing something wrong? Or, is this a bug in Git?

I would expect if you push to an empty repo, it would update it (because denyCurrentBranch = updateInstead).

Thanks
Next: Junio C Hamano
Message 1 of 7 in “Trying to push into empty repo, get fatal: bad revision 'HEAD'”
  1. Samuel WilliamsMar 31, 2015
  2. Junio C HamanoApr 1, 2015
  3. Junio C HamanoApr 1, 2015
  4. Junio C HamanoApr 1, 2015
  5. Johannes SchindelinApr 1, 2015
  6. Junio C HamanoApr 1, 2015
  7. Johannes SchindelinApr 2, 2015

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.