title: Display GitHub README screenshot stored in a different branch, both on GitHub and locally
body: <p><strong>Update:</strong> This is the <a href="https://github.com/devliber/ReadmeScreenshotBranch" rel="nofollow noreferrer">GitHub test repository</a> for this question.</p>
  
  <p>I'm storing a screenshot (<code>screenshot.png</code>) in a separate Git branch (<code>assets</code>), to be used in a README.md file (on the <code>master</code> branch).</p>
  
  <p>To see the image on GitHub, I have to link to:</p>
  
  <pre><code>/../assets/screenshot.png
  </code></pre>
  
  <p>or</p>
  
  <pre><code>../assets/screenshot.png
  </code></pre>
  
  <p>However, this does not work when viewing the README file locally, the image is not displayed (such as when using the Markdown preview feature in VS Code or Atom).</p>
  
  <p>I have even used the <em>git worktree</em> feature, to check out the <em>assets</em> branch in the <em>assets</em> subdirectory:</p>
  
  <pre><code>git worktree add -B assets assets origin/assets
  </code></pre>
  
  <p>so the directory structure is something like this:</p>
  
  <pre><code>.git
  assets
  assets/screenshot.png
  README.md
  </code></pre>
  
  <p>This means that, in order to view the image locally in the README file, I have to link to</p>
  
  <pre><code>/assets/screenshot.png
  </code></pre>
  
  <p>or</p>
  
  <pre><code>assets/screenshot.png
  </code></pre>
  
  <p>How can I reconcile the two "worlds"?</p>
  
  <p>Is there a way to link to the screenshot so it's always displayed, "whether I view the documentation on GitHub itself, or locally, using a different markup renderer"<a href="https://blog.github.com/2013-01-31-relative-links-in-markup-files/" rel="nofollow noreferrer">*</a>?</p>