Question: I merged changes from another repo to my repo and resulted in one conflict that is a copyright comment in all Java classes:

```
<<<<<<< HEAD
 * Copyright (C) 2010-2017 Peter, Sofi, and Others
=======
 * Copyright (C) 2010-2018 Peter, Sofi, and Others
>>>>>>> 01e35t13155963q84e8e05b7101235488c50f4e639eew3c4

```

The conflict is trivial and easy to solve but the issue is that this conflict appears on more than 50 Java classes which I think is difficult to go through all of them and resolve the conflict manually.

Is there a quick way to resolve this conflict in all the classes automatically? BTW, I use Eclipse.

Answer: 
You can use `git rerere`

To enable rerere functionality, you simply have to run this config setting:

```
$ git config --global rerere.enabled true

```

[![enter image description here](https://i.stack.imgur.com/MQvch.png)](https://i.stack.imgur.com/MQvch.png)

When we merge the two branches together, we’ll get a merge conflict:

```
$ git merge i18n-world
Auto-merging hello.rb
CONFLICT (content): Merge conflict in hello.rb
Recorded preimage for 'hello.rb'
Automatic merge failed; fix conflicts and then commit the result.

```

Now you can resolve it to just be puts 'hola mundo' and you can run git rerere diff again to see what rerere will remember:

```
$ git rerere diff
--- a/hello.rb
+++ b/hello.rb
@@ -1,11 +1,7 @@
 #! /usr/bin/env ruby

 def hello
-<<<<<<<
-  puts 'hello mundo'
-=======
-  puts 'hola world'
->>>>>>>
+  puts 'hola mundo'
 end

```

So that basically says, when Git sees a hunk conflict in a hello.rb file that has “hello mundo” on one side and “hola world” on the other, it will resolve it to “hola mundo”.

[![enter image description here](https://i.stack.imgur.com/Y0qYQ.png)](https://i.stack.imgur.com/Y0qYQ.png)
What you're looking for is `git rerere`. This will save conflict resolutions for you. You can find some extra information [here in this doc entry](https://git-scm.com/docs/git-rerere). This will reuse the conflict resolution provided the next one will be identical.