I have following branches in remote origin.
Since Git version 2.6, you can specify partial substrings (with simple glob-style matching) in a fetch or push refspec. Hence:
git fetch origin 'refs/heads/ft_d*:refs/remotes/origin/ft_d*'
would do what you are asking for. Generalized regular expressions are not available, nor generalized globs: only the one specific case of
* matching everything between two fixed strings is allowed. (Some fixed strings here may be empty. Usually the back half is, i.e., we usually fetch
refs/heads/*x to get just branches whose name ends in
If your Git is older than 2.6, there is no simple way to do this in one fetch. You will need multiple fetches, in a loop, and you will need to do your own name-matching, perhaps using the output from
git fetch origin will normally just bring everything over, as specified in the
remote.origin.fetch configuration entry or entries, and in most cases there's little point in constraining
git fetch this way. Are you sure you want to bother?)