title: How to ensure same git checkout for build and deploy jobs in Jenkins?
body: <p>In Jenkins, I have a "Build" job setup to poll my git repo and automatically build on change.    Then, I have separate "Deploy to DEV", "Deploy to QA", etc. jobs that will call an Ant build that deploys appropriately.  Currently, this configuration works great.</p>
  
  <p>However, this process favors deploying the latest build on the latest development branch.  I use the Copy Artifact plugin to allow the user to choose which build to deploy.  Also, the Ant scripts for build/deploy are part of the repo and are subject to change.  This means it's possible the artifact could be incompatible between versions.  So, it's ideal that I ensure that the build and deploy jobs are run using the same git checkout.</p>
  
  <p>Is there an easier way?  It ought to be possible for the Deploy job to obtain the git checkout hash used from the selected build and checkout.  However, I don't see any options or plugins that do this.</p>
  
  <p>Any ideas on how to simplify this configuration?</p>