Solved git cannot fetch src tree

Code:
Fetching origin
remote: Enumerating objects: 23234, done.
remote: Counting objects: 100% (23234/23234), done.
remote: Compressing objects: 100% (198/198), done.
remote: Total 82039 (delta 23122), reused 23036 (delta 23036), pack-reused 58805
Receiving objects: 100% (82039/82039), 52.23 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (63713/63713), completed with 3130 local objects.
From https://git.freebsd.org/src
   f5ddeabc08e..2430d82b40e  releng/12.2                        -> origin/releng/12.2
   283e60fb310..c5f4772c66d  main                               -> origin/main
   a4deddc0de3..7fe589000ce  releng/11.4                        -> origin/releng/11.4
   8023e729a52..b368bb75bad  releng/13.0                        -> origin/releng/13.0
   3a5f854f458..f80ee27f447  stable/11                          -> origin/stable/11
   434ffdacd55..43a58daffe7  stable/12                          -> origin/stable/12
   3d5f931a771..6aee7855180  stable/13                          -> origin/stable/13
   8b6f73e37ba..ee914ef902a  vendor/NetBSD/bmake                -> origin/vendor/NetBSD/bmake
   584d8a41f5a..04751ecc449  vendor/NetBSD/vis                  -> origin/vendor/NetBSD/vis
   1e02e5b0ba8..395770967c3  vendor/acpica                      -> origin/vendor/acpica
   62023a0e6de..1f4f67f5242  vendor/ena-com                     -> origin/vendor/ena-com
   b4125f7d51d..e4bbddaec86  vendor/llvm-project/release-12.x   -> origin/vendor/llvm-project/release-12.x
error: cannot lock ref 'refs/remotes/origin/vendor/openzfs/legacy': 'refs/remotes/origin/vendor/openzfs' exists; cannot create 'refs/remotes/origin/vendor/openzfs/legacy'
! [new branch]              vendor/openzfs/legacy              -> origin/vendor/openzfs/legacy  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/vendor/openzfs/master': 'refs/remotes/origin/vendor/openzfs' exists; cannot create 'refs/remotes/origin/vendor/openzfs/master'
! [new branch]              vendor/openzfs/master              -> origin/vendor/openzfs/master  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/vendor/openzfs/zfs-2.1-release': 'refs/remotes/origin/vendor/openzfs' exists; cannot create 'refs/remotes/origin/vendor/openzfs/zfs-2.1-release'
! [new branch]              vendor/openzfs/zfs-2.1-release     -> origin/vendor/openzfs/zfs-2.1-release  (unable to update local ref)
   efec8223892..40c7ff83e74  vendor/wpa                         -> origin/vendor/wpa
* [new tag]                 llvmorg-12.0.1-rc2-0-ge7dac564cd0e -> llvmorg-12.0.1-rc2-0-ge7dac564cd0e
* [new tag]                 vendor/NetBSD/bmake/20210621       -> vendor/NetBSD/bmake/20210621
* [new tag]                 vendor/NetBSD/vis/20210621         -> vendor/NetBSD/vis/20210621
* [new tag]                 vendor/acpica/20210604             -> vendor/acpica/20210604
* [new tag]                 vendor/ena-com/2.4.0               -> vendor/ena-com/2.4.0
* [new tag]                 vendor/openzfs/20210210            -> vendor/openzfs/20210210
error: Could not fetch origin

Is this normal behaviour, and if so, how is it normally handled?
 
This is what I got.
Code:
cd /usr/src/
doas git pull
Password:
remote: Enumerating objects: 67, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 41 (delta 33), reused 17 (delta 9), pack-reused 0
Unpacking objects: 100% (41/41), 6.39 KiB | 31.00 KiB/s, done.
From [URL]https://git.freebsd.org/src[/URL]
   b74cdf1ec..b368bb75b  releng/13.0 -> origin/releng/13.0
Updating b74cdf1ec..b368bb75b
error: Your local changes to the following files would be overwritten by merge:
    lib/libc++/Makefile
    lib/libcasper/libcasper/libcasper_impl.c
    lib/libcasper/libcasper/libcasper_impl.h
    lib/libcasper/libcasper/service.c
    lib/libcasper/libcasper/zygote.c
    sys/compat/linux/linux_futex.c
    sys/conf/newvers.sh
    sys/net/if_vlan.c
    sys/netpfil/ipfw/ip_fw_pfil.c
    tools/build/mk/OptionalObsoleteFiles.inc
Please commit your changes or stash them before you merge.
Aborting
 
You will have to remove the following branch

Code:
vendor/openzfs

It is due to the fact that there is a local branch named vendor/openzfs, but on the remote there is two branches: vendor/openzfs/legacy and vendor/openzfs/master which require that there is no existing branch named vendor/openzfs (or even just named vendor)
 
You will have to remove the following branch

Code:
vendor/openzfs

It is due to the fact that there is a local branch named vendor/openzfs, but on the remote there is two branches: vendor/openzfs/legacy and vendor/openzfs/master which require that there is no existing branch named vendor/openzfs (or even just named vendor)
Thanks. Only now my /usr/src is missing.
 
You will have to remove the following branch

Code:
vendor/openzfs
There is no such branch.

It is due to the fact that there is a local branch named vendor/openzfs,
There is no such branch.

There is only a remote branch origin/vendor/openzfs. Last commit on that branch is:
Code:
commit d76d37d9c3f33de9155c16f3b1eceb288c0702a0 (origin/vendor/openzfs)
Author: Martin Matuska <mm@FreeBSD.org>
Date:   Wed Apr 14 08:03:07 2021 +0200

    Update vendor/openzfs to openzfs/zfs/master@3522f57b6



but on the remote there is two branches: vendor/openzfs/legacy and vendor/openzfs/master which require that there is no existing branch named vendor/openzfs (or even just named vendor)
I understand that there is a name clash. I want to know how it appeared, and how it is to be processed in fully automated mode.
 
Try git pull -p, that should remove remote branches that no longer exist.

Code:
       -p, --prune
           Before fetching, remove any remote-tracking references that no
           longer exist on the remote. Tags are not subject to pruning if they
           are fetched only because of the default tag auto-following or due
           to a --tags option. However, if tags are fetched due to an explicit
           refspec (either on the command line or in the remote configuration,
           for example if the remote was cloned with the --mirror option),
           then they are also subject to pruning. Supplying --prune-tags is a
           shorthand for providing the tag refspec.
 
You can set this to be automated by using git config --global fetch.prune true and git config --global fetch.pruneTags true. Or use --local within the repository if you only want it to apply to that repository.
 
You can set this to be automated by using git config --global fetch.prune true and git config --global fetch.pruneTags true. Or use --local within the repository if you only want it to apply to that repository.
Thank You, that seems to do the same as SirDice suggested. And I have only one place where this is called.
 
Back
Top