Vendor import push failed: src refspec ... does not match any

From: Gregory Shapiro <gshapiro_at_freebsd.org>
Date: Mon, 09 Jan 2023 02:31:26 UTC
I'm doing my first vendor import since the move to git.  Following the
instructions in section 5.4 of committers-guide/#git-primer, I hit a
roadblock trying to push the new version to the vendor branch.  My
actions are below, including the failure to push at the end.  What
should have I have done differently?


> cd src/freebsd/main
> git remote -v
freebsd https://git.freebsd.org/src.git (fetch)
freebsd git@gitrepo.freebsd.org:src.git (push)
> git pull
Already up to date.
> git status
On branch main
Your branch is up to date with 'freebsd/main'.

nothing to commit, working tree clean
> git worktree add ../vendor/sendmail freebsd/vendor/sendmail
Preparing worktree (detached HEAD 0694dcb04b81)
HEAD is now at 0694dcb04b81 Bring in fix from upstream that allows libsm to compile against FreeBSD 13
> cd ../vendor/sendmail
> rsync --archive --delete --exclude=.git ~/Work/fb/sendmail-8.17.1/ ./
> git add -A
> 
...
(checked git status, git diff, all looked good at first, though after
 the error, I see that git status reports, "Not currently on any
 branch.")
...
> git commit -m "Vendor import of sendmail 8.17.1"
[detached HEAD e2db8b1cc34e] Vendor import of sendmail 8.17.1
 188 files changed, 13741 insertions(+), 8635 deletions(-)
 create mode 100644 cf/feature/check_other.m4
 create mode 100644 cf/feature/sts.m4
 mode change 100644 => 100755 contrib/doublebounce.pl
 mode change 100644 => 100755 contrib/link_hash.sh
 mode change 100644 => 100755 contrib/re-mqueue.pl
 create mode 100644 devtools/OS/Darwin.19.x
 create mode 100644 devtools/OS/Darwin.20.x
 create mode 100644 include/sm/ixlen.h
 create mode 100644 libsm/ilenx.c
 create mode 100644 libsm/lowercase.c
 create mode 100644 libsm/strcaseeq.c
 create mode 100644 libsm/t-ixlen.c
 create mode 100755 libsm/t-ixlen.sh
 create mode 100644 libsm/t-str2prt.c
 create mode 100644 libsm/t-streq.c
 create mode 100755 libsm/t-streq.sh
 create mode 100644 libsm/utf8_valid.c
 create mode 100644 libsm/uxtext_unquote.c
 create mode 100644 libsm/xleni.c
 create mode 100755 libsmutil/t-lockfile-0.sh
 create mode 100644 libsmutil/t-lockfile.c
 create mode 100755 libsmutil/t-maplock-0.sh
> git tag -a -m "Tag sendmail 8.17.1" vendor/sendmail/8.17.1
> git push --dry-run --follow-tags freebsd vendor/sendmail
error: src refspec vendor/sendmail does not match any
error: failed to push some refs to 'gitrepo.freebsd.org:src.git'

Note that the output to git commit above starts with "[detached HEAD
...]" which, along with the git status issue described above, looks
suspicious.