get all branches from remote

C++
You can fetch all branches from all remotes like this:
git fetch --all

Source

Also in C++: