0

I'm using TortoiseGit on Windows 7/64bit

I got a merge conflict and Resolving gave me the option of choosing THEIRS or MINE. And when I chose MINE, it rolled back to one or two checkins back.

But I'm using it locally. I do have an online repository, which only I use. I did try to PUSH my changes yesterday but it failed (I forget the reason, sorry).

POSSIBLE CAUSES 1. NEW I edit these .html files within a VM but yesterday I edited them from my actual machine. Same file directory and files being edited. Could that make GIT "think" that two different people are editing the files? 2. Could doing a failed PUSH somehow make it appear to to the local Git that my local changes are THEIRS?

Clay Nichols
  • 11,090
  • 25
  • 101
  • 162
  • Git doesn't care about *who*, really (the user names in commits are purely for your information / examination). It cares about the *commit graph*. From the command line, use `git log --graph --oneline --decorate --all` to get a nice(ish...) view of the graph. From TortoiseGit on Windows, I have no idea, I don't use WIndows. – torek Oct 13 '16 at 17:31
  • If you changed the files in a VM, you may have changed the line ending style (CR+LF in Windows vs. LF in Linux etc.). Depending on the configuration, the files may be marked to be different, but in a diff viewer they look the same and they may even be shown as identical, if the viewer ignores line endings. (This happened to me with Mercurial, don't know how the git tools behave here.) – Rainer Schwarze Oct 13 '16 at 18:02

1 Answers1

0

In Git conflicts can only occur on a merge (a pull is a fetch + a merge).

Theirs and mine reflect the origin on the changes:

  • THEIRS is the version of file from the branch you are merging
  • MINE is the version of the file of your current branch

When you got a conflict, then git was not able to resolve those changes automatically. Here you can resolve the conflict by taking the whole file of your on the branch's version (as you did, then all changes of the other branch are lost) or you an edit the conflict. In that case a conflict editor opens where you can see the changes of both branches and can select the lines you want to keep.

Also see https://tortoisegit.org/docs/tortoisegit/tgit-dug-conflicts.html and How to resolve merge conflicts in Git?

Community
  • 1
  • 1
MrTux
  • 28,370
  • 24
  • 91
  • 123
  • I am still confused about how I could get such a conflict if I am the only one editing and Committing to this local repo. Any thoughts? (Also, updated Question w/ more info) – Clay Nichols Oct 13 '16 at 17:24
  • Do you use several banches? Stashed changes? All these are cases where conflicts can occurr. – MrTux Oct 13 '16 at 20:03