How to fix

How to synchronize local Git with remote Git by overwriting local changes


Git is a distributed version control system / revision control system. It’s used for tracking changes in source code during software development.

In general all the changes in the branches. So you need at least one brach for each feature. When feature is done it merges to master branch. And you may want to delete feature-branch.

Also you may have uncommitted changes, which you don’t need. So, it’s time to cleanup!

To sync local git repository with remote git repository, and overwrite local changes type:

git fetch origin \
&& git reset --hard origin/master \
&& git clean -f -d

Now your local git version is equal to remote version.