I keep my vim configuration files on github to keep them synched across multiple machines. Once in a while I use a machine I haven’t used in a while and the vim files are way out of synch. If I simply
git pull
from remote the directory becomes messy since old files (or renamed files) not present anymore in the official remote stay put. So what I typically do is to delete everything and git clone from scratch.
Is that the best approach? Ideally I would like to have a command
git xxx
which delete/replace everything making a perfect replica of the remote
Where
originis the remote, andmasteris the remote branch you want to your local working copy to be in sync with. Note that these commands replace any local files (including changes) with the remote state. That means that there will be no merge conflicts. It mimics your delete-and-reclone workflow.