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

[PATCH 2/2] Allow non-fast-forward of remote tracking branches in default clone

From
Junio C Hamano <junkio@cox.net>
Date
Dec 29, 2006, 00:32 UTC
Message-ID
<7vk60btucu.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vzm97tzbt.fsf@assigned-by-dhcp.cox.net>

This changes the default remote.origin.fetch configuration created by git-clone so that it allows non-fast-forward updates.

When using the separate-remote layout with reflog enabled, it does not make much sense to refuse to update the remote tracking branch just because some of them do not fast-forward. git-fetch issues warnings on non-fast-forwardness, and the user can peek at what the previous state was using the reflog.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-clone.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index f37eb9d..3d388de 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -388,7 +388,7 @@ then
 
 		# Set up the mappings to track the remote branches.
 		git-repo-config remote."$origin".fetch \
-			"refs/heads/*:$remote_top/*" '^$' &&
+			"+refs/heads/*:$remote_top/*" '^$' &&
 		rm -f "refs/remotes/$origin/HEAD"
 		git-symbolic-ref "refs/remotes/$origin/HEAD" \
 			"refs/remotes/$origin/$head_points_at" &&
-- 
1.5.0.rc0.gf5c587
Previous: Junio C HamanoNext: Shawn Pearce
Message 8 of 14 in “branch.pu.forcefetch”
  1. Pavel RoskinDec 27, 2006
  2. Jakub NarebskiDec 27, 2006
  3. Junio C HamanoDec 27, 2006
  4. Jakub NarebskiDec 27, 2006
  5. Pavel RoskinDec 28, 2006
  6. Junio C HamanoDec 28, 2006
  7. 1/2 core.logallrefupdates: log remotes/ tracking branches.Junio C Hamano, Dec 29, 2006
  8. 2/2 Allow non-fast-forward of remote tracking branches in default cloneJunio C Hamano, Dec 29, 2006
  9. Shawn PearceDec 29, 2006
  10. Johannes SchindelinDec 29, 2006
  11. Pavel RoskinDec 29, 2006
  12. Junio C HamanoDec 29, 2006
  13. Pavel RoskinDec 29, 2006
  14. Shawn PearceDec 29, 2006

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.