title: Conflict merging fork on `package.json` on name/version
body: <h1>TL;DR :</h1>
  
  <p>I want to avoid conflicts each time I'm merging my bumped base project <strong>package.version</strong> in the forked one containing a different <strong>package.name</strong>.</p>
  
  <h1>Issue :</h1>
  
  <h2>Context</h2>
  
  <p>I maintain two git repos, named here <code>base</code> and <code>fork</code>, each contains a shared <code>package.json</code> and the <code>package-lock.json</code> accordingly. They got a propert <code>name</code> to <code>base</code> and <code>base_fork</code> respectively, the second has been updated since the first commit after forking. Each lives in gitlab context and the second is created with the fork option of gitlab.</p>
  
  <h2>Workflow</h2>
  
  <p>A version bump happen in <code>base</code>, I update the lockfile with an <code>npm i</code> then push to <code>base</code> master branch. I'm starting a merge request with gitlab from <code>base</code> master to <code>fork</code> master. This one fail due to conflict that I need to resolve manually in <code>package.json</code> and <code>package-lock.json</code> :</p>
  
  <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
    "name": "fork",
    "version": "1.0.0",
  =======
    "name": "base",
    "version": "1.0.1"
  &gt;&gt;&gt;&gt;&gt;&gt;&gt; xxxxxxxx
  </code></pre>
  
  <p>So, I'm taking <code>name</code> from HEAD and <code>version</code> from commit xxxxxxxx. And push to resolve conflict.</p>
  
  <h2>Problem</h2>
  
  <p>The conflict appear due to <code>name</code> change + <code>version</code> change. Technically, git detect a conflict, I can understand why, but it's boring me ^^ . So, I moved away the version line from <code>package.json</code> that's fixing the problem for this file but the <code>package-lock.json</code> is a solid I can't manage like that.</p>
  
  <h2>So!</h2>
  
  <p>I think the problem can be reproduce with a branching system since it's just a merging business but this case happen clearly in a fork context with this kind of change. I understand my problem come from the conflict detection I could solve but there is one file I can't manage.</p>
  
  <p>To be clear a last time about what I'm waiting for here :</p>
  
  <p>A way to avoid conflict during merge from <code>base</code> to <code>fork</code> on specific declared lines. In this case the lines 2~3 of <code>package-lock.json</code>.</p>
  
  <p>Any ways are welcome :)</p>
  
  <p>EDIT:</p>
  
  <p>Following @inigo solution, I'm investigate <a href="https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver" rel="nofollow noreferrer">custom merge driver solutions</a> taking <a href="https://github.com/Praqma/git-merge-driver" rel="nofollow noreferrer">praqma sample</a> as model.</p>