0

When I have a merge-conflice in file then Git shows the two different "versions" in the file like this

<<<<< HEAD
some lines
in this
file
======================

which makes it easy to step through the file and keep/delete what you want.

If I have pushed some changes from PC 1 while working on PC 2 I sometimes get this aborting-error that "some local changes would be overwitten, please stash or commit the changes" when I pull on PC 2.

Is there a way to show the difference between local-changes and what is being pulled just like how the merge-conflict is handled?

CutePoison
  • 4,679
  • 5
  • 28
  • 63
  • Note that if you do make a commit from the changes, you'll get any conflicts that might happen. There might actually not *be* any conflicts; Git may be able to do the merge on its own; but for Git to do so, you *must make a commit first*. Don't be afraid of making commits! If you don't like the commit, you can get rid of it (and the subsequent merge). – torek Nov 13 '20 at 07:26
  • If you only want to see the changes at the beginning you can use this [script](https://gist.github.com/jtdp/5443297). But I would use [`git rebase` instead of `git merge`](https://stackoverflow.com/a/804156/10951752). – flaxel Nov 13 '20 at 07:30

0 Answers0