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

[PATCH] helpful error message when send-pack finds no refs in common.

From
ACAndrew Clausen <clausen@econ.upenn.edu>
Date
Oct 16, 2007, 21:31 UTC
Message-ID
<20071016213139.GF13454@econ.upenn.edu>
Hi all,
Please cc me, I'm not subscribed.

git-push fails when pushing into an empty repository if you don't specify a branch:

	git --bare init some-repo
	git-push some-repo
To get this to work, you need to do
	git-push some-repo master
I attached a patch so that the error message suggests trying the latter.

Cheers, Andrew

>From ee888ea1a7d2e75a0439569e36eabe4620e8f833 Mon Sep 17 00:00:00 2001
Date: Tue, 16 Oct 2007 17:16:05 -0400
Subject: [PATCH] helpful error message when send-pack finds no refs in common.
Signed-off-by: Andrew Clausen <clausen@econ.upenn.edu>
---
 send-pack.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/send-pack.c b/send-pack.c
index f74e66a..f0b0825 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -204,7 +204,8 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha
 		return -1;
 
 	if (!remote_refs) {
-		fprintf(stderr, "No refs in common and none specified; doing nothing.\n");
+		fprintf(stderr,
+			"No refs in common and none specified; doing nothing.\n"			"Perhaps you should specify a branch such as 'master'.\n");
 		return 0;
 	}
 
-- 
1.5.3.1
Message 1 of 1 in “helpful error message when send-pack finds no refs in common.”
  1. helpful error message when send-pack finds no refs in common.Andrew Clausen, Oct 16, 2007

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.