title: Git push to master repo then send the dist folder to a specific path(/www/site/v0.0.1)?
body: <p>So the goal is to push my project to a core repo, where all my development files live, for backup purposes.</p>
  
  <p>Then I want to send the <code>dist</code> folder to a directory like <code>www/site.com/v0.0.1</code>, for demonstration purposes, no development files are needed, it would just cause bloat because I have multiple directories.</p>
  
  <hr>
  
  <p>So what I have right now is a <code>.gitignore</code> that ignores pretty much everything but the <code>dist</code>. </p>
  
  <p>I ran <code>git rm -r --cache</code> and now I am only pushing the <code>dist</code>, but now the pitfall is I cant back up my core repo, in case my local environment is destroyed, then all I have is all this compiled code, and I am not reverse engineering that.</p>
  
  <pre><code>#!/bin/sh
  currentVersion=git describe --abbrev=0
  mkdir /var/www/example.com/public_html/projects/$currentVersion
  git --work-tree=/var/www/example.com/public_html/projects/$currentVersion --git-dir=/var/repo/cool.git checkout -f
  </code></pre>
  
  <hr>
  
  <p>I can think of two situations </p>
  
  <ol>
  <li><p>Two remote repos (core.git, demos.git), <code>git add remote &lt;ssh-repo/core.git &amp; demos.git&gt;</code>, the pitfall is with <code>.gitignore</code> how am I supposed to specify which repo uses the ignores? Also two repos kind of sucks.</p></li>
  <li><p>Inside the bash script write something that enables me to ignore files, then add another worktree, or possibly just use a linux command to just take the dist and put it into my desired version for this <code>post-receive</code> event?</p></li>
  </ol>
  
  <p>A third could possibly use branches, I am still a git novice and am not sure what I can do.</p>
  
  <p><strong>EDIT:</strong> So obviously two repos is stupid if I am just pushing the dist folder, so I think in the bash script I need to somehow take just the dist folder and use a command to copy it into my desired path.</p>