title: Can't checkout to a new branch - ansible git
body: <p>I am trying to create a playbook where i can checkout to any branch just by changing a variable. The git section of the playbook is:</p>
  
  <pre><code>- name: Clone repository
    git: 
      repo: "{{ repo_url }}"
      dest: /some_path
      key_file: some_path_to_a_file
      version: "{{ repo_tag }}"
      force: yes
  </code></pre>
  
  <p>I first used <code>repo_tag=master</code> and it worked. Then I created a new branch called dev and tried with <code>repo_tag=dev</code>. It says that it can't checkout to that tag. The issue seems to be that the module is not fetching before doing the checkout.</p>
  
  <p>What am i doing wrong on my play?</p>
  
  <p>Edit:
  As a temporary workaround i am just deleting the repository folder before the cloning, but that forces a clone even when it is not necessary.</p>