title: Updating a branch with JGit also seems to update the master branch
body: <p>I have two files that I wish to merge</p>
  <p>the base file is like so (a):</p>
  <pre><code>base file here
  no changes made
  </code></pre>
  <p>then let's say the user updates this file by adding (b):</p>
  <pre><code>base file here
  no changes made
  user made one change here
  </code></pre>
  <p>and the admin also changed this file like so (c):</p>
  <pre><code>base file here
  no changes made
  admin made change here
  </code></pre>
  <p>I am using JGit to merge the changes into one, ideally the result should be something like this</p>
  <pre><code>base file here
  no changes made
  user made one change here
  admin made change here
  </code></pre>
  <p>I have imported the JGit library and am writing a module in kotlin that will perform this operation, it goes like so:</p>
  <pre><code>//init repo
  val git = Git.init().setDirectory(gitRoot).call()
  //this is the file that will be commited
  val target = File(git.repository.directory.parent, &quot;file.txt&quot;)
  copyFile(&quot;base.txt&quot;,target) //we copy the base version of the file to the folder
  git.add().addFilepattern(&quot;file.txt&quot;).call() //add it 
  val baseCommit = git.commit().setMessage(&quot;Initial Commit&quot;).call() //and commit
  log(&quot;Base File: ${target.readText()}&quot;) //the file looks correctly like (a)
  val uBranch = git.checkout().setName(&quot;user&quot;).setCreateBranch(true).setStartPoint(baseCommit).call()
  copyFile(&quot;user.txt&quot;,target) //we copy the user's version of the file to the folder
  git.commit().setMessage(&quot;changed&quot;).call()//and commit it
  val aBranch = git.checkout().setName(&quot;admin&quot;).setCreateBranch(true).setStartPoint(baseCommit).call()
  copyFile(&quot;admin.txt&quot;,target) //we copy the admin's version of the file to the folder    
  git.commit().setMessage(&quot;updated&quot;).call() //and commit it
  
  git.checkout().setName(&quot;master&quot;).call() //here I iterate through the branches to make sure the changes took place
  log(&quot;master: ${target.readText()}&quot;) //this is supposed to look like (a) but it looks like (c)
  git.checkout().setName(&quot;user&quot;).call()
  log(&quot;changed: ${target.readText()}&quot;) //this is supposed to look like (b) but it looks like (c)
  git.checkout().setName(&quot;admin&quot;).call()
  log(&quot;updated: ${target.readText()}&quot;) //this correctly looks like (c)
  </code></pre>
  <p>am I missing something? I copied the whole commit procedure from the documentation and examples, but it seems that whenever I commit a change into one branch, the previous branches get updated</p>