Skip to content

Commit

Permalink
Merge pull request #214 from arimallick/patch-1
Browse files Browse the repository at this point in the history
Solves issue #210
  • Loading branch information
arshadkazmi42 authored Mar 25, 2023
2 parents 4e110b3 + 0473c80 commit 674d5b8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions commands/git/git-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@

`git push origin newbranch`

### Demo
`git push origin newbranch --force`

`git push newbranch --force-with-lease`

`--force` overwrites a remote branch with your local branch. <br>

<img src="../../gifs/git-push.gif" alt="Git Push"/> <br>
`--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](https://user-images.githubusercontent.com/116898892/227696642-8d6c2cf3-366f-48d4-b1f6-bacc286f84d0.gif)

### Related

- [Check status](git-status.md)
- [Switch Branch](git-switch-branch.md)
- [Switch Branch](git-switch-branch.md)

0 comments on commit 674d5b8

Please sign in to comment.