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
, so it is followed by what branch
is 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
Previous: How does CSS implement this border?
Next: Ask the boss for help with the sorting problem of multi-dimensional arrays