title: git add, commit, push using Ansible to Azure Repo
body: <p>A developer just finished making changes to some code on a Dev server that received a <code>git clone</code> from an Azure git Repository using Ansible.</p>
  <blockquote>
  <p><strong>What specific syntax must be used in Ansible tasks to <code>add</code>, <code>commit</code>, and <code>push</code> the developer's changed code from the Dev server back to the same Azure git Repository?</strong></p>
  </blockquote>
  <p>The following is the <code>git clone</code> Ansible task that was contributed by <a href="https://stackoverflow.com/questions/64672204/interactive-password-support-for-ansible-clone-of-azure-repository/64672381#64672381">@garylopez</a>:</p>
  <pre><code>--- 
  - name: Clone repo playbook
    hosts: dev
  
    vars_prompt: 
      - name: &quot;git_password&quot; 
        prompt: &quot;Password for 'https://OrganizationName@dev.azure.com'&quot;
        private: yes 
  
    tasks:
    - name: Clone a repo 
      git:
        repo: https://{{ git_user | urlencode }}:{{ git_password | urlencode }}@dev.azure.com/OrganizationName/ProjectName/_git/RepositoryName
        dest: /src/RepositoryName  
  </code></pre>
  <p>We have examined the Ansible <code>git</code> module's <a href="https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html" rel="nofollow noreferrer">docs</a>, but do not see a boilerplate example.</p>
  <p>We imagine someone might resort to some sort of shell command solution in Ansible tasks if the Ansible <code>git</code> module does not support this.  But we are asking here hoping that a best practice type approach might be offered in an answer.</p>