Clean up your Git repo fork and update it from upstream aka start clean

Peter Jausovec
1 min readMay 3, 2023

This is more of a note for myself because I search for this occasionally.

Here’s the scenario — you fork a Git repo, clone the fork, and set up two remotes:

  • origin — points to your forked repository
  • upstream — points to the source repo (i.e., the repo you created the fork from)

At some point, you might end up in a state where your local fork is not clean anymore (perhaps you committed something, experimented, etc.), and the upstream…