Tracking a single remote branch as a local branch is straightforward enough.
$ git checkout --track -b ${branch_name} origin/${branch_name}
without any scripting (in an empty directory):
$ git clone --bare repo_url .git $ git config core.bare false $ git checkout
after that, all remote branches will be seen as local.
original (in russian).