# How create new Git repository from Ansible  directly?

**URL:** <https://forum.ansible.com/t/how-create-new-git-repository-from-ansible-directly/23453>\
**Category:** Ansible Project\
**Created:** [January 13, 2017, 12:08pm UTC](https://forum.ansible.com/t/how-create-new-git-repository-from-ansible-directly/23453 "2017-01-13T12:08:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SwApNiL\_PATIL](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SwApNiL\_PATIL](https://forum.ansible.com/u/SwApNiL_PATIL)\
**Post date:** [January 13, 2017, 12:08pm UTC](https://forum.ansible.com/t/how-create-new-git-repository-from-ansible-directly/23453/1 "2017-01-13T12:08:15Z")

</div>

Hello All ,

I am only able to clone the repository from Git with the help of Git module of Ansible. I am able to create new repository from shell and attach that shell script to Ansible.  
**But I want to know can I create new repository in Git from ansible directly with the help of Git module of Ansible ?**

Your help is much appreciated.

Thanks,  
Swapnil Patil.

---

<div class="post-metadata">

**Author:** ![Igor\_Homyakov](https://avatars.discourse-cdn.com/v4/letter/i/f4b2a3/32.png) [@Igor\_Homyakov](https://forum.ansible.com/u/Igor_Homyakov)\
**Post date:** [January 13, 2017, 7:02pm UTC](https://forum.ansible.com/t/how-create-new-git-repository-from-ansible-directly/23453/2 "2017-01-13T19:02:23Z")

</div>

Hi,

You simply can't. Git module is supposed to be used to manage git  
\*\*checkouts\*\* of repositories.  
However command module can be useful for you

- command: git init {{ repository }}

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 13, 2017, 7:05pm UTC](https://forum.ansible.com/t/how-create-new-git-repository-from-ansible-directly/23453/3 "2017-01-13T19:05:52Z")

</div>

> Hello All ,
> 
> I am only able to clone the repository from Git with the help of Git module  
> of Ansible. I am able to create new repository from shell and attach that  
> shell script to Ansible.  
> \*But I want to know can I create new repository in Git from ansible  
> directly with the help of Git module of Ansible ?\*

Probably not as the documentation says  
"Manage `git' checkouts of repositories to deploy files or software."

> Your help is much appreciated.

But you could use the command module to achieve this.
