git pull of /usr/src fails

Hello,

I am trying to update the /usr/src repository and I am getting this error:
Bash:
# git -C /usr/src pull
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/legacy': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/legacy'
From https://git.FreeBSD.org/src
 ! [new branch]              vendor/openzfs/legacy          -> freebsd/vendor/openzfs/legacy  (unable to update local ref)
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/master': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/master'
 ! [new branch]              vendor/openzfs/master          -> freebsd/vendor/openzfs/master  (unable to update local ref)
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/zfs-2.1-release': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/zfs-2.1-release'
 ! [new branch]              vendor/openzfs/zfs-2.1-release -> freebsd/vendor/openzfs/zfs-2.1-release  (unable to update local ref)
This is uname -a:
Bash:
# uname -a
FreeBSD joseland.home 13.0-STABLE FreeBSD 13.0-STABLE #40 stable/13-n245691-024a9aa7010: Tue Sep 14 12:48:13 CEST 2021     root@joseland.home:/usr/obj/usr/src/amd64.amd64/sys/MYKERNEL  amd64
It seems something silly, but any idea how to fix it?

Thanks in advance.
 
The reason you need to add the -p option is because a few branches were removed, and a normal git pull would try to update those. It will fail because those branches don't exist anymore. Adding the -p option "prunes" those deleted branches.
 
Back
Top