I need to do a subtree merge for a specific branch, if it exists on a given remote repository. The problem is that the remote repository is not checked out locally, so I can
You can add the repository you have as a remote using git remote add something https://github.com/project-name/project-name.git and then do a git remote show something to get all information about the remote. This requires a network connection and is useful for human use.
Alternatively, do a git fetch something. This will fetch all branches on the remote called something and keep them in your local repository. You can then merge them into your local branch as you please. I recommend this path since if you finally decide that you have to merge, this is what you need to do.
OT: Your use of "checked out locally" indicates that you're approaching this from a centralised version control system standpoint. That's usually a dead end when you're dealing with git. It uses words like "checkout" etc. differently from how older systems did.