0

I'm trying to merge in some files, but get:

#added by them: sass/main.scss

Since I've also added this file, I'd like to look at 'theirs' and see what they've done on it.

I've tried git diff sass/main.scss but this doesnt work.

Would anyone know the correct way of doing this?

MeltingDog
  • 14,310
  • 43
  • 165
  • 295

2 Answers2

1

For any file with conflict, you can check the different versions with:

git show :1:aFile
git show :2:aFile
git show :3:aFile

That is:

  • Stage #1: common ancestor of the files,
  • stage #2: target-branch version,
  • Stage #3: version you are merging from.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • See also the comments of http://stackoverflow.com/q/41811411/6309, and http://stackoverflow.com/a/3305914/6309 – VonC Feb 21 '17 at 05:26
0

The easiest way to view a file is to open it in your favorite text editor. Since the file was "added by them", you already know that the diff is the entire file.

I've tried git diff sass/main.scss but this doesnt work.

git diff sass/main.scss compares the given file with the index. If you have already merged and not made any changes then the diff will be empty. (I assume this is what you mean by "doesn't work.") To see a diff with your work, you need to specify a commit-ish to compare with. For example

$ git diff HEAD~ -- sass/main.scss
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268