I have a remote branch that is the basis for a pullrequest.
I mainly worked on a different branch, however that should now replace the old branch.
I tried to do a
git push remote oldBranch -f
git checkout oldBranch
git branch -m 'oldBranchToBeReplaced'
git checkout newBranch
git branch -m oldBranch
git push myrepo oldBranch -f
You can use the
local-name:remote-name syntax for git push:
git push origin newBranch:oldBranch
newBranch, but using the name
oldBranch on origin.
oldBranch probably already exists, you have to force it:
git push origin +newBranch:oldBranch
(I prefer the
+ instead of
-f will work, too)
To delete a branch on the remote side, push an "empty branch" like so:
git push origin :deleteMe