New Jenkins instance building old commits

I have a few freestyle jobs that have been migrated to a fresh Jenkins instance with Ansible. It created a job named after the old one and copied the config.xml file.
The jobs have two types of branch specifiers:

  • **
    or
  • :^(?!.^(master|origin/master)$).$

The problem is that the migrated jobs that start from #1 try to build the very first commits that have been pushed into the repo (and there are 10-20k commits)

Also, the weird thing is that when I set the branch specifier to */master it only builds newest commits from the master branch.

How do I make Jenkins build only the newest commits from these other branches?

Hello @rippie and welcome to this community :wave:

Is your SCM GitHub? Did you declare your jobs as a GitHub project?
What are the build triggers?
Do you have a webhook your projects responds to?
Thanks.

The SCM is GitHub and builds are triggered by webhooks

How does the webhook page look on GitHub?
Can you see tons of of webhooks there?