Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 830 Bytes

git-push.md

File metadata and controls

26 lines (15 loc) · 830 Bytes

Push the changes

git push {{FROM}} {{BRANCH}}

  • FROM: Where to push(The repository cloned from)
  • BRANCH: What to push(the new branch)
Example:

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.

Demo

git-push

Related