Skip to content

Commit

Permalink
Solves issue #210
Browse files Browse the repository at this point in the history
Fixed the following changes:
1. Introduced difference between git push --force & git push --force-with-lease
2. Fixed "GIF not showing" under DEMO tag in git-push.md
  • Loading branch information
arimallick authored Mar 25, 2023
1 parent 4e110b3 commit 42504bc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions commands/git/git-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@

`git push origin newbranch`

### Demo
#### Difference between:
`git push --force` & `git push --force-with-lease`

`force` overwrites a remote branch with your local branch. <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.

<img src="../../gifs/git-push.gif" alt="Git Push"/> <br>
[Click here to see the orginial git commit on the same.](https://github.com/git/git/commit/28f5d176110d2ed768a0a49159993c7a02d8cb15)


### 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 42504bc

Please sign in to comment.