git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexander Huynh <alex@grande.coffee>
To: git@vger.kernel.org
Subject: [BUG] fetching all remote branches results in failed multiple updates
Date: Thu, 7 Mar 2019 21:44:47 +0000	[thread overview]
Message-ID: <20190307214447.GA4909@chabuduo> (raw)

Hello all,

When running the latest release of git, I receive an error when attempting to
fetch all remote branches from a repo:

    fatal: multiple updates for ref 'refs/remotes/origin/maint' not allowed

The specific ref that it fails on changes depending on the repository, but the
end result is the repo isn't cloned.

The specific configuration that causes this bug is the `remote.origin.fetch`
option, specifically:

    [remote "origin"]
    	fetch = +refs/heads/*:refs/remotes/origin/*

These settings are listed as an example in "CONFIGURED REMOTE-TRACKING
BRANCHES" of git-fetch(1), as well as expanded upon in
https://stackoverflow.com/a/40739835.

I'm running git version 2.21.0.

Full reproduction steps are below:

    [root@chabuduo ~]# useradd -m git-test -s /bin/bash
    [root@chabuduo ~]# sudo --preserve-env=SSH_AUTH_SOCK -u git-test -i
    [git-test@chabuduo ~]$ git --version
    git version 2.21.0
    [git-test@chabuduo ~]$ cat > ~/.gitconfig
    [remote "origin"]
    	fetch = +refs/heads/*:refs/remotes/origin/*
    [git-test@chabuduo ~]$ cat ~/.gitconfig
    [remote "origin"]
    	fetch = +refs/heads/*:refs/remotes/origin/*
    [git-test@chabuduo ~]$ git clone git@github.com:git/git.git
    Cloning into 'git'...
    Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
    remote: Enumerating objects: 265113, done.
    remote: Total 265113 (delta 0), reused 0 (delta 0), pack-reused 265113
    Receiving objects: 100% (265113/265113), 113.20 MiB | 5.49 MiB/s, done.
    Resolving deltas: 100% (196542/196542), done.
    fatal: multiple updates for ref 'refs/remotes/origin/maint' not allowed

             reply	other threads:[~2019-03-07 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 21:44 Alexander Huynh [this message]
2019-03-07 23:40 ` [BUG] fetching all remote branches results in failed multiple updates SZEDER Gábor
2019-03-08  0:08   ` Alexander Huynh
2019-03-08  1:09     ` Junio C Hamano
2019-03-13 23:45       ` Alexander Huynh
2019-03-14 17:20         ` Alexander Huynh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307214447.GA4909@chabuduo \
    --to=alex@grande.coffee \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).