I have realized that I can use git update-ref to fast-forward existing branch that I am not on. Then I have found that similar thing can be done by git branch -f
With git branch -f, it would refuse to update the branch if it is the one checked out (so if it is the "current branch")
git update-ref has not that limitation.
Qqwy adds another difference in the comments:
git branch -f []
will create a new branch called
if it did not exist. git update-ref
will do nothing in this case.