Set otherbranch
to point at the same commit as currentbranch
by running
git branch -f otherbranch currentbranch
The -f
(force) option tells git branch
yes, I really mean to overwrite any existing otherbranch
reference with the new one.
From the documentation:
-f
–forceReset to if exists already. Without -f git branch refuses to change an existing branch.