Skip to content

Commit 7c9f3c8

Browse files
committed
git push --force-with-lease tip
1 parent 7b4bcd1 commit 7c9f3c8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
130130
* [Adding Remote name](#adding-remote-name)
131131
* [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file)
132132
* [Group commits by authors and title](#group-commits-by-authors-and-title)
133+
* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work)
133134

134135
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
135136
<!-- @doxie.inject end toc -->
@@ -900,5 +901,10 @@ git blame <file-name>
900901
git shortlog
901902
```
902903

904+
## Forced push but still ensure you don't overwrite other's work
905+
```sh
906+
git push --force-with-lease <remote-name> <branch-name>
907+
```
908+
903909
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
904910
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,4 +389,7 @@
389389
}, {
390390
"title": "Group commits by authors and title",
391391
"tip": "git shortlog"
392+
}, {
393+
"title": "Forced push but still ensure you don't overwrite other's work",
394+
"tip": "git push --force-with-lease <remote-name> <branch-name>"
392395
}]

0 commit comments

Comments
 (0)