git push {{FROM}} {{BRANCH}}
- FROM: Where to push(The repository cloned from)
- BRANCH: What to push(the new branch)
git push origin newbranch
git push origin newbranch --force
git push newbranch --force-with-lease
--force
overwrites a remote branch with your local branch.
--force-with-lease
is a safer option that will not overwrite any work on the remote branch if more commits were added to the remote branch (by another team-member working on the same repository). It ensures you do not overwrite someone elses work by force pushing.