Code is showing the entire commit history for branches that don't have an upstream, which is pretty wild considering they didn't implement any display limit or collapse functionality.
The feature actually looks useful and meaningful when you have set an upstream.
If you'd like to keep the graph for some branches and just disable it for certain branches or repositories, you can set an upstream branch. If you don't have an upstream you want to use, you can do the hacky trick of setting a branch's upstream to itself. For example, if your branch is main
...
git remote add here .
git fetch here
git branch --set-upstream-to here/main
Big disclaimer: normally git prevents you from setting a branch as its own upstream. Adding a repo as its own remote is the workaround. I have no idea whether this will cause damage to your repository.