Why do I need to eliminate config.local to checkout

I did some dvc add and then some dvc commit before setting up my remote

Setting up this remote created a config.local file.

however now when I do git checkout to a previous commit and try dvc checkout I get

dvc checkout -v
2024-11-11 22:22:22,338 DEBUG: v3.56.0 (pip), CPython 3.10.12 on Linux-6.8.0-48-generic-x86_64-with-glibc2.35
2024-11-11 22:22:22,338 DEBUG: command: /path/to/folder//otraVenv/bin/dvc checkout -v
2024-11-11 22:22:22,537 ERROR: configuration error - config file error: expected ‘url’ for dictionary value @ data[‘remote’][‘origin’]
Traceback (most recent call last):
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/cli/init.py”, line 210, in main
cmd = args.func(args)
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/cli/command.py”, line 21, in init
self.repo: Repo = Repo(uninitialized=self.UNINITIALIZED)
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/repo/init.py”, line 205, in init
hardlink_lock=self.config[“core”].get(“hardlink_lock”, False),
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/funcy/objects.py”, line 25, in get
res = instance.dict[self.fget.name] = self.fget(instance)
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/repo/init.py”, line 243, in config
return Config(
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/config.py”, line 115, in init
self.load(
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/config.py”, line 191, in load
conf = self.validate(conf)
File “/path/to/folder//otraVenv/lib/python3.10/site-packages/dvc/config.py”, line 390, in validate
raise ConfigError(str(exc)) from None
dvc.config.ConfigError: config file error: expected ‘url’ for dictionary value @ data[‘remote’][‘origin’]

2024-11-11 22:22:22,589 DEBUG: Analytics is enabled.
2024-11-11 22:22:22,624 DEBUG: Trying to spawn [‘daemon’, ‘analytics’, ‘/tmp/tmp2ipgmwzi’, ‘-v’]
2024-11-11 22:22:22,629 DEBUG: Spawned [‘daemon’, ‘analytics’, ‘/tmp/tmp2ipgmwzi’, ‘-v’] with pid 136603

I actually found out the reason in a reply I got to a previous question here so I removed the config.local and now I can dvc checkout

But that gives the question: config.local can not be git managed so it wont dissapear if I git checkout to a previous commit. Do I have to manually erase it for dvc checkout to function. that seems kind of impractical…