title: Capistrano 3 removing .git folder
body: <p>Our code uses the git repository in order to get the version of the app (we make something like <code>{git-tag}-build{git-hash}</code> and we're using Capistrano to deploy our application.</p>
  
  <p>However, using Capistrano v3.0 (ran by Jenkins) I found that the git repository is removed.</p>
  
  <p>I tried to make something similar to this:</p>
  
  <pre><code>namespace :environment do
      desc 'Copies .git folder'
      task :copy_git do
          on roles(:app) do
              within release_path do
                  execute :mkdir, ".git"
                  execute :cp, "-R * .git/"
              end
          end
      end
  end
  </code></pre>
  
  <p>But as you may understand, it doesn't work.</p>
  
  <p>This is the issue I get:</p>
  
  <p><code>Could not get version string (no version file and</code>git describe<code>failed)</code>.</p>
  
  <p>Any idea on how to solve this or how to have the .git folder inside the release_path? Any other idea on versioning is acceptable.</p>