Can't checkout a branch after a recent update to the array_api_compat submodule

Hey git gurus,

I’m trying to checkout out a branch that I last updated a week or so ago. git checkout overhaul gives this error:

error: The following untracked working tree files would be overwritten by checkout:
subprojects/array_api_compat/meson.build
Please move or remove them before you switch branches.
Aborting

Presumably this is because of the recent update of the array_api_compat submodule. What is the recommended way to update a branch with a git submodule change like this?

rm -rf subprojects/array_api_compat
# or if you want a blunter hammer:
# rm -rf subprojects
git checkout overhaul
git submodule update --init

Ah, of course, a simple blunt hammer!

Thanks.

I am getting the same thing. @lucascolley do we need to fetch the latest changes from subprojects/array_api_compat, or something else to avoid this?

The problem is that the file at the path subprojects/array_api_compat/meson.build was previously part of the scipy git repo but is now part of a git submodule. I think this file has to be deleted somehow when switching branches, but maybe there is some kind of force flag to do this automatically. LLM probably knows best :slight_smile:

git -C subprojects/array_api_compat clean -dffx array_api_compat

seems to work for me. It does not show anymore.