I’ve not worked on a project quite some time and have just tried to pull the latest version.
I can’t remember the last time I’d worked on the project but I’d obviously had changes made to the Master that I’d not pushed. As I’ve received some conflict warnings.
Is there anyway to ignore my previous commits and pull down the master to overwrite my files?
What do you recommend I do in this situation?
I’m assuming that you’ve resolved the conflicts now, so that the first commit in
git logis a merge commit.Firstly, it’s a good idea save where your old
masterbranch was, just in case you want to go back. You can do that with:Then, if you want to reset your
masterbranch to the version ofmasterthat you’ve just fetched from theoriginrepository, you can do that withgit reset --hard:Note that
git reset --hardis a dangerous command – it will throw away any uncommitted changes, which is why I suggest making sure that the output ofgit statusis clean before using it.