Skip to content

Commit 013672b

Browse files
author
Junio C Hamano
committed
Allow non-fast-forward of remote tracking branches in default clone
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>
1 parent e19b9dd commit 013672b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ then
388388

389389
# Set up the mappings to track the remote branches.
390390
git-repo-config remote."$origin".fetch \
391-
"refs/heads/*:$remote_top/*" '^$' &&
391+
"+refs/heads/*:$remote_top/*" '^$' &&
392392
rm -f "refs/remotes/$origin/HEAD"
393393
git-symbolic-ref "refs/remotes/$origin/HEAD" \
394394
"refs/remotes/$origin/$head_points_at" &&

0 commit comments

Comments
 (0)