-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# git push --force-with-lease | ||
|
||
Source: | ||
|
||
- <https://stackoverflow.com/questions/52823692/git-push-force-with-lease-vs-force> | ||
- <https://git-scm.com/docs/git-push> | ||
|
||
`--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 or co-worker or what have you). It ensures you do not overwrite someone else work by force pushing. | ||
|
||
For now, "some reasonable default" is tentatively defined as "the value of the remote-tracking branch we have for the ref of the remote being updated", and it is an error if we do not have such a remote-tracking branch. |