git-pull
uses git-fetch
.
See https://git-scm.com/docs/git-fetch for its documentation, especially the "Configure remote-tracking branches" section (attached verbatim below).
Looking at that, you can only whitelist patterns, not exclude some. What you could do therefore is one of:
- Manually list the branches you want to pull from instead of the wildcard
- Get everyone to use a prefix for all branches, so that you can distinguish between
Dev/*
and Foo/*
git fetch allows you to configure remote.<repository>.fetch configuration variables.
Typically such a variable may look like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
This configuration is used in two ways:
When git fetch is run without specifying what branches and/or tags to fetch on the command line, e.g. git fetch origin or git fetch, remote.<repository>.fetch values are used as the refspecs—they specify which refs to fetch and which local refs to update. The example above will fetch all branches that exist in the origin (i.e. any ref that matches the left-hand side of the value, refs/heads/) and update the corresponding remote-tracking branches in the refs/remotes/origin/ hierarchy.