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

[PATCH] git-fetch: Allow fetching the remote HEAD

From
SBSanti Béjar <sbejar@gmail.com>
Date
Jan 30, 2007, 09:36 UTC
Message-ID
<87fy9sluuf.fsf@gmail.com>
... with:
$ git fetch ${remote} HEAD
Also
$ git fetch ${remote} :${localref}
worked, but
$ git fetch ${remote} HEAD:{localref}
didn't. Now both are equivalent.
Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-parse-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 9d26967..3e783b7 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -183,7 +183,7 @@ canon_refs_list_for_fetch () {
 			done
 		fi
 		case "$remote" in
-		'') remote=HEAD ;;
+		'' | HEAD ) remote=HEAD ;;
 		refs/heads/* | refs/tags/* | refs/remotes/*) ;;
 		heads/* | tags/* | remotes/* ) remote="refs/$remote" ;;
 		*) remote="refs/heads/$remote" ;;
-- 
1.5.0.rc2.224.gb3a6
Next: Junio C Hamano
Message 1 of 2 in “git-fetch: Allow fetching the remote HEAD”
  1. git-fetch: Allow fetching the remote HEADSanti Béjar, Jan 30, 2007
  2. Junio C HamanoJan 30, 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.