paint-brush
Why You Can Sometimes Use git push -f: Rewriting Code Repository Historyby@shepelev
6,933 reads
6,933 reads

Why You Can Sometimes Use git push -f: Rewriting Code Repository History

by Alexey ShepelevDecember 24th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The git push -f command removes all commits, which are not in the local version, from the server branch and writes new ones. The same commit can appear in several branches at the same time. When we try to merge a branch with rewritten history and branches where the history has been preserved, we will get a great number of conflicts (according to the number of commits) There is an unpleasant side of rewriting history: those commits that seem to be removed from the branch do not actually disappear anywhere and simply remain forever hanging in the repo.
featured image - Why You Can Sometimes Use git push -f: Rewriting Code Repository History
Alexey Shepelev HackerNoon profile picture
Alexey Shepelev

Alexey Shepelev

@shepelev

L O A D I N G
. . . comments & more!

About Author

Alexey Shepelev HackerNoon profile picture
Alexey Shepelev@shepelev

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite