I tried many answers here but still couldn't checkout to a remote branch, turns out that when I first cloned the repo, I had added --single-branch
flag which could be the reason why I was encountering the error when trying to create a new branch from a remote branch, to resolve this problem we can update the repository's configuration to fetch all branches from the remote repository:
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"git fetchgit branch -r
and now we can continue with
git checkout -b feature/FS origin/feature/FS