title: Correctly committing versioned, and built (minified) files to GitHub with Gulp.js
body: <p><strong>Background info</strong></p>
  
  <p>I am writing a small JavaScript library and would like to make the contribution flow as easy as possible if others end up wanting to contribute. Currently, I am experiencing issues with versioning built files that go in the <code>dist</code> folder.</p>
  
  <p>I am using:</p>
  
  <ul>
  <li>Git for version control, and Github for repository management.</li>
  <li>Gulp.js for building the source files and committing and pushing versioned files</li>
  </ul>
  
  <p>Gulp runs a build task that concatenates, and minifies JavaScript files into a <code>all.min.js</code> file and places that file in a <code>dist</code> folder. The trouble I am having is making releases based on that folder. </p>
  
  <p><strong>Things I've tried</strong></p>
  
  <p><strong>1.</strong>
  Let the normal git flow occur even with built files. What I mean by this is that when a user creates a pull-request to master, one of the diffs would be the <code>all.min.js</code>. This often will cause conflicts, and when the pull-request is confirmed, the <code>all.min.js</code> is no longer tagged with "version1.x.x".</p>
  
  <p><strong>2.</strong>
  My next idea was to add the <code>dist</code> folder to <code>.gitignore</code> and then use an npm package during the gulp build process to comment out the <code>dist</code> folder, commit and push, and then uncomment the line.</p>
  
  <p>This of course does not work because as long as the <code>dist</code> folder exists in the repo, <code>.gitignore</code> will not work for that particular item.</p>
  
  <p><strong>3.</strong>
  The last idea is when the developer is developing, to build those files to a <code>build</code> folder, and add that folder to <code>.gitignore</code>. This way, when I use Gulp to "release" I don't have a conflict of files, and tagging is consistent. The release tasks, and only those tasks would push to the <code>dist</code> folder. However, I still feel that this way is too open for mistakes. But, maybe this solution is the best.</p>
  
  <p><strong>The Question:</strong>
  How can I improve any of these flows to get a consistent development cycle going?</p>