Synchronizing a local Git repository with a remote one

I want to synchronize my local repository with a remote one so that my local repository becomes a 100% copy of the remote one – meaning that if certain files differ in these repositories, we override the local ones with the remote ones, and if there are files in local repositories that do not exist in the remote, the local files get removed.

Is there any way to achieve that other than by doing a fresh clone of remote repository?

Similar question as Sync local git repo with remote in one shot discarding local changes/commits.

11 Answers
11

Leave a Comment