Skip to content

Git之强制覆盖分支

使用A分支覆盖B分支,可以执行以下操作:

bash
git checkout B
git reset --hard origin/dev
git push -f
git checkout B
git reset --hard origin/dev
git push -f

或者

bash
git push origin A:B -f
git push origin A:B -f