I encountered this issue when trying to fetch from a local repo:
git fetch /my/local/path my_branch
This syntax gets rid of the warning:
git fetch file:///my/local/path my_branch
But I would prefer a way to tell git to not store anything in my config about this local path.