When git manages the remote warehouse branch-- does set-upstream-to always report an error?


I don't know exactly what you want to achieve. If you just want to know why this command is wrong, literally set-upstream-to is to set the tracking branch of the current branch , feeling that you need a parameter , that is, the branch to be tracked:

git branch --set-upstream-to origin/dev

set-upstream literally means to set the tracking branch of what branch is , so it is followed by two parameters , that is, local branch name and online branch name .
so to replace set-upstream with set-upstream-to , you need to first switch to the local branch where you want to set the tracking branch, and then use set-upstream-to to set the online branch you want to track:

git checokut dev
git branch --set-upstream-to origin/dev
Menu