0

I'm using GitX to work with a Git repository for a project. Somehow, things got out of sync and although I can pull the latest changes, I can't commit anything because it thinks there is an unresolved conflict in a particular file. Yet, when I resolve the conflict, the file disappears from the staging view, so I can't commit it and end up back where I was.

What I want to do is just pull all the latest changes from the repo and discard any and all of my local changes, so that my local copy is exactly identical to the repo. I have only made a few simple changes, and would rather just make them again (once everything is in sync) then continue to go in circles trying to merge.

I'm thinking a "reset master to here" on the latest commit and switching the toggle to "hard" would do the trick:

Resets the index and working tree. Any changes to tracked files in the working tree are discarded. Warning! This discards all changes. It may be hard to recover them.

I just want to be sure that this is referring to my local changes being discarded. Is that correct? Would this update my local to an exact mirror of what's in the repo?

1 Answer 1

0

If you want to get an exact mirror of the origin, without any local changes, you may just delete your local repo and type 'git clone '.

Unfortunately, GitX is not a replacement for command-line git, but an addon to a subset of functions the latter provides.

Yes, the hard reset you have mentioned does the trick as well,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .