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

Written by shepelev | Published 2020/12/24
Tech Story Tags: git | github | gitlab | git-workflow | programming | coding | coding-skills | repositories-on-github

TLDR 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.via the TL;DR App

no story

Written by shepelev | Senior Ruby on Rails Developer
Published by HackerNoon on 2020/12/24