Updating Ports using Git

FreeBSD 13.3

I've got a crontab running as follows to update the ports tree ...

/usr/local/bin/git -C /usr/ports pull --ff-only --quiet

which until recently has been running fine. Now I'm getting an error as follows ...

Code:
error: Your local changes to the following files would be overwritten by merge:

and the list is getting longer. Any ideas?
 
AFAIK, If you have local changes on the ports tree, you can't pull new changes onto them. First, make sure you are added them and committed, then you can rebase or merge new changes but i prefer to rebase onto them.

git add .
git commit -m "my local changes"
git pull --rebase

Can you show us your git status in /usr/ports?
 
I've had this happen on several git trees. It would claim there were local changes and basically marked every file as "changed". Seems to be a bug in git(1) itself. Removing the tree and doing a fresh clone resolved the issue, it's a bit brute-force but its the quickest and simplest way.
 
Quite a big list but I do get emailed updates to install most days as a result of
cd /usr/ports && make index and then /usr/sbin/pkg version -v -L '='

so not sure how this list has come about.

Code:
On branch main
Your branch is behind 'origin/main' by 445 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
modified:   MOVED
modified:   Tools/scripts/pypi-get-latest-version.sh
modified:   archivers/bzip3/Makefile
modified:   archivers/bzip3/distinfo
modified:   cad/py-amaranth/Makefile
modified:   cad/py-amaranth/distinfo
modified:   converters/p5-Convert-PEM/Makefile
modified:   converters/p5-Convert-PEM/distinfo
modified:   databases/redis_exporter/Makefile
modified:   databases/redis_exporter/distinfo
modified:   devel/binaryen/Makefile
modified:   devel/binaryen/distinfo
modified:   devel/glaze/Makefile
modified:   devel/glaze/distinfo
modified:   devel/hotspot/Makefile
modified:   devel/jenkins/Makefile
modified:   devel/jenkins/distinfo
modified:   devel/libnjs/Makefile
modified:   devel/libnjs/distinfo
new file:   devel/libnjs/files/patch-auto_quickjs
modified:   devel/libnjs/pkg-plist
modified:   devel/llvm-devel/Makefile
modified:   devel/llvm-devel/Makefile.snapshot
modified:   devel/llvm-devel/distinfo
modified:   devel/llvm-devel/files/patch-clang_tools_clang-format_git-clang-format
new file:   devel/llvm-devel/files/patch-flang_runtime_stop.cpp
modified:   devel/llvm-devel/pkg-plist
modified:   devel/llvm19/Makefile
modified:   devel/llvm19/distinfo
new file:   devel/llvm19/files/patch-backport-3b10e31d3a4a
modified:   devel/p5-CPAN-Meta-YAML/Makefile
modified:   devel/p5-CPAN-Meta-YAML/distinfo
modified:   devel/p5-Date-Manip/Makefile
modified:   devel/p5-Date-Manip/distinfo
modified:   devel/p5-Date-Manip/pkg-plist
modified:   devel/p5-Shell-Guess/Makefile
modified:   devel/p5-Shell-Guess/distinfo
modified:   devel/p5-String-Diff/Makefile
modified:   devel/p5-String-Diff/distinfo
modified:   devel/p5-Sub-Name/Makefile
modified:   devel/p5-Sub-Name/distinfo
modified:   devel/p5-Test-Inter/Makefile
modified:   devel/p5-Test-Inter/distinfo
modified:   devel/p5-carton/Makefile
modified:   devel/p5-carton/distinfo
modified:   devel/py-proxmoxer/Makefile
modified:   devel/py-proxmoxer/distinfo
modified:   devel/py-pytest-pycodestyle/Makefile
modified:   devel/py-pytest-pycodestyle/distinfo
modified:   devel/py-pytest-qt/Makefile
modified:   devel/py-pytest-qt/distinfo
modified:   devel/py-python-rapidjson/Makefile
modified:   devel/py-python-rapidjson/distinfo
modified:   devel/py-single-version/Makefile
modified:   devel/py-single-version/distinfo
modified:   devel/qtcreator/Makefile
modified:   devel/qtcreator/distinfo
modified:   devel/qtcreator/files/patch-src_libs_utils_algorithm.h
modified:   devel/qtcreator/files/patch-src_plugins_qmldesigner_CMakeLists.txt
modified:   devel/qtcreator/files/patch-src_tools_process__stub_main.cpp
modified:   devel/qtcreator/pkg-plist
modified:   editors/ox/Makefile
modified:   editors/ox/Makefile.crates
modified:   editors/ox/distinfo
modified:   editors/texstudio/Makefile
modified:   editors/texstudio/distinfo
modified:   finance/Makefile
new file:   finance/electrs/Makefile
new file:   finance/electrs/distinfo
new file:   finance/electrs/pkg-descr
modified:   finance/gnucash-docs/Makefile
modified:   finance/gnucash-docs/distinfo
modified:   finance/gnucash-docs/pkg-plist
modified:   finance/gnucash/Makefile
modified:   finance/gnucash/distinfo
modified:   ftp/unftp/Makefile
modified:   ftp/unftp/distinfo
modified:   graphics/p5-Image-ExifTool-devel/Makefile
modified:   graphics/p5-Image-ExifTool-devel/distinfo
modified:   graphics/p5-Image-Info/Makefile
modified:   graphics/p5-Image-Info/distinfo
modified:   java/openjdk11/Makefile
modified:   lang/njs/Makefile
modified:   lang/njs/distinfo
new file:   lang/njs/files/patch-auto_quickjs
modified:   lang/typstyle/Makefile
modified:   lang/typstyle/distinfo
modified:   mail/thunderbird/Makefile
modified:   mail/thunderbird/distinfo
modified:   math/R-cran-sf/Makefile
modified:   math/R-cran-sf/distinfo
modified:   math/saga/Makefile
modified:   math/saga/distinfo
modified:   math/saga/files/patch-CMakeLists.txt
modified:   math/saga/pkg-plist
modified:   misc/llama-cpp/Makefile
modified:   misc/llama-cpp/distinfo
modified:   multimedia/youtui/Makefile
modified:   multimedia/youtui/distinfo
new file:   net-im/telegram-desktop/files/patch-Telegram_lib__base_base_qt_qt__compare.h
modified:   net-mgmt/py-pynetbox/Makefile
modified:   net-mgmt/py-pynetbox/distinfo
modified:   net-p2p/ogmios/Makefile
modified:   net-p2p/ogmios/distinfo
modified:   net-p2p/ogmios/files/patch-cabal.project
modified:   net/freerdp3/Makefile
modified:   net/freerdp3/distinfo
modified:   net/freerdp3/pkg-plist
modified:   net/s5cmd/Makefile
modified:   net/s5cmd/distinfo
modified:   net/tigervnc-server/Makefile
new file:   net/usockets/files/libusockets.pc.in
modified:   science/py-mpcontribs-client/Makefile
modified:   science/py-mpcontribs-client/distinfo
modified:   science/py-mplhep-data/Makefile
modified:   science/py-mplhep-data/distinfo
modified:   science/py-mplhep/Makefile
modified:   science/py-mplhep/distinfo
modified:   security/Makefile
modified:   security/R-cran-openssl/Makefile
modified:   security/R-cran-openssl/distinfo
new file:   security/py-openssh-wrapper/Makefile
new file:   security/py-openssh-wrapper/distinfo
new file:   security/py-openssh-wrapper/pkg-descr
modified:   security/s2n-tls/Makefile
modified:   security/s2n-tls/distinfo
modified:   security/vuxml/vuln/2024.xml
modified:   shells/oksh/Makefile
modified:   shells/oksh/distinfo
modified:   sysutils/mise/Makefile
modified:   sysutils/mise/distinfo
modified:   textproc/Makefile
renamed:    textproc/mdocml/Makefile -> textproc/mandoc/Makefile
renamed:    textproc/mdocml/distinfo -> textproc/mandoc/distinfo
renamed:    textproc/mdocml/files/patch-msec.in -> textproc/mandoc/files/patch-msec.in
new file:   textproc/mandoc/pkg-descr
renamed:    textproc/mdocml/pkg-plist -> textproc/mandoc/pkg-plist
deleted:    textproc/mdocml/pkg-descr
modified:   textproc/p5-XML-Twig/Makefile
modified:   textproc/p5-XML-Twig/distinfo
modified:   textproc/py-mkdocs-rss-plugin/Makefile
modified:   textproc/py-mkdocs-rss-plugin/distinfo
modified:   textproc/py-ocrmypdf/Makefile
modified:   textproc/py-ocrmypdf/distinfo
modified:   textproc/py-os-api-ref/Makefile
modified:   textproc/py-os-api-ref/distinfo
modified:   textproc/sigil/Makefile
modified:   textproc/sigil/distinfo
modified:   www/element-web/Makefile
modified:   www/element-web/distinfo
modified:   www/element-web/pkg-plist
modified:   www/forgejo/Makefile
modified:   www/forgejo/distinfo
modified:   www/gitea/Makefile
modified:   www/gitea/distinfo
new file:   www/ladybird/files/patch-Ladybird_Qt_SettingsDialog.cpp
modified:   www/nginx-devel/Makefile
modified:   www/nginx-devel/Makefile.extmod
modified:   www/nginx-devel/distinfo
modified:   www/nginx-devel/files/extra-patch-njs-auto-quickjs
new file:   www/nginx-devel/files/extra-patch-njs-nginx-config
modified:   www/py-kiss-headers/Makefile
modified:   www/py-kiss-headers/distinfo
modified:   www/py-pywikibot/Makefile
modified:   www/py-pywikibot/distinfo
modified:   www/trunk/Makefile
modified:   www/trunk/distinfo
modified:   www/tt-rss/Makefile
modified:   www/tt-rss/distinfo
modified:   www/tt-rss/pkg-plist
modified:   www/unit/Makefile
modified:   x11-toolkits/kddockwidgets/Makefile
modified:   x11-toolkits/kddockwidgets/distinfo
modified:   x11-toolkits/kddockwidgets/pkg-plist
modified:   x11-toolkits/py-magicgui/Makefile
modified:   x11-toolkits/py-magicgui/distinfo
modified:   x11/py-pynput/Makefile
modified:   x11/py-pynput/distinfo
modified:   x11/py-pynput/files/patch-setup.py
 
This is only safe if you're sure you haven't made any changes to your ports tree:
Code:
git -C /usr/ports restore --staged .
git -C /usr/ports restore .

The first command un-stages your local changes from the index and puts them in your working tree. The seconds discards all changes in the working tree.
 
Back
Top