I have a remote branch, which is the basis for pullrequest.
I mainly worked in another branch, but now I have to replace the old branch.
I tried to do it git push remote oldBranch -f, but it only pushes my last local oldBranchto git server instead of the current branch - regardless of which branch I am in now.
How to replace a remote branch with my local branch?
EDIT: If anyone is interested, here is how I got this to work:
git checkout oldBranch
git branch -m 'oldBranchToBeReplaced'
git checkout newBranch
git branch -m oldBranch
git push myrepo oldBranch -f
source
share