# need clarification on git module update option

**URL:** <https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933>\
**Category:** Ansible Project\
**Created:** [December 2, 2014, 8:30am UTC](https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933 "2014-12-02T08:30:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cliffano\_Subagio](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Cliffano\_Subagio](https://forum.ansible.com/u/Cliffano_Subagio)\
**Post date:** [December 2, 2014, 8:30am UTC](https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933/1 "2014-12-02T08:30:16Z")

</div>

Hi,

I would like to get some clarification on the intention of update option in git module.

My original understanding:

- when update=yes, then repo will be cloned once and then updated via git pull every time

- when update=no, then repo will be cloned once but would never be updated with git pull and it will just return repo information

Which seemed correct until this change [https://github.com/ansible/ansible/commit/28f6a18ef6add2f43b0e9a489f5d914f3b882403](https://github.com/ansible/ansible/commit/28f6a18ef6add2f43b0e9a489f5d914f3b882403) which fixed this issue [https://github.com/ansible/ansible/issues/8630](https://github.com/ansible/ansible/issues/8630) .

After the change:

- when update=yes, the behaviour is still the same as my original understanding

- when update=no, then the module will never be cloned it will just return repo information. this is the confusing part because ‘update’ by definition indicates updating an already cloned repo. The change also means that it’s no longer possible to clone the repo once only without further updates, which I think would be a common use case.

The documentation on [http://docs.ansible.com/git\_module.html](http://docs.ansible.com/git_module.html) only mentions “If no, just returns information about the repository without updating.”

Is it the intention that update=no means to never clone?  
If so, is there any other way to support clone once and never update?

Cheers,  
Cliff.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [December 3, 2014, 1:15am UTC](https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933/2 "2014-12-03T01:15:25Z")

</div>

I don't know the proper answer to your question, the docs definitely  
could be interpreted either way right now. And there does seem to be  
a use case for update=no not doing an initial clone but you're not the  
first person to request update=no to do an initial clone:

[https://github.com/ansible/ansible-modules-core/issues/426](https://github.com/ansible/ansible-modules-core/issues/426)

-Toshio

---

<div class="post-metadata">

**Author:** ![Cliffano\_Subagio](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Cliffano\_Subagio](https://forum.ansible.com/u/Cliffano_Subagio)\
**Post date:** [December 3, 2014, 1:38am UTC](https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933/3 "2014-12-03T01:38:14Z")

</div>

Thanks for the pointer to that issue. I’ll move the discussion there.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [December 3, 2014, 4:47am UTC](https://forum.ansible.com/t/need-clarification-on-git-module-update-option/16933/4 "2014-12-03T04:47:13Z")

</div>

Oh sorry, I didn’t mean to push the discussion onto the ticket - just pointing out that it exists so other people are interested in it. Mailing lists are often better than tickets for discussing how we want things to behave. Then we can use the ticket to hammer out implementation of that behavior.

Apologies,  
-Toshio
