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

message on no-args push to an empty repo

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Mar 13, 2010, 01:59 UTC
Message-ID
<2e24e5b91003121759k34ec294cl8a57ef22eda2bbf5@mail.gmail.com>
Hello,

When someone is doing the *first* push to an empty remote repo, and they try to use the no-args "git push", they get this:

> No refs in common and none specified; doing nothing.
> Perhaps you should specify a branch such as 'master'.
> fatal: The remote end hung up unexpectedly
> error: failed to push some refs to 'git@gitsrv:testsite.git'

This is a fairly clear message, except that by only mentioning the branch name, and not the remote name, it perhaps confuses people into doing this:

> $ git push master
>
> fatal: 'master' does not appear to be a git repository
> fatal: The remote end hung up unexpectedly

The correct answer of course is "git push origin master", and yes I realise they should read the git-push manpage...

Can we think of a possible wording change to that message to help this situation? For example, would it be safe to assume the remote would always (in such cases) be "origin" and say:

    Perhaps you should specify the remote and the branch explicitly,
like 'git push origin master'
Regards,
Sitaram
Next: Jeff King
Message 1 of 2 in “message on no-args push to an empty repo”
  1. Sitaram ChamartyMar 13, 2010
  2. Jeff KingMar 14, 2010

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.