# Correct way to get ansible and modules from github and how to keep it tracking devel?

**URL:** <https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365>\
**Category:** Ansible Developer\
**Tags:** vmware\
**Created:** [May 5, 2016, 5:28pm UTC](https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365 "2016-05-05T17:28:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [May 5, 2016, 5:28pm UTC](https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365/1 "2016-05-05T17:28:44Z")

</div>

Got a new Mac and decided to get ansible from github vs copying it from my old Mac.

$ git --version  
git version 2.8.2

$ git clone [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)

$ git submodule update --init --recursive

$ cd ansible/lib/ansible/modules/core  
$ git remote -v  
origin [https://github.com/ansible/ansible-modules-core](https://github.com/ansible/ansible-modules-core) (fetch)  
origin [https://github.com/ansible/ansible-modules-core](https://github.com/ansible/ansible-modules-core) (push)

$ git status

HEAD detached from 9db1233  
nothing to commit, working directory clean

Why is HEAD detached?

$ cd …/extras/

$ git remote -v  
origin [https://github.com/ansible/ansible-modules-extras](https://github.com/ansible/ansible-modules-extras) (fetch)  
origin [https://github.com/ansible/ansible-modules-extras](https://github.com/ansible/ansible-modules-extras) (push)

$ git status  
HEAD detached at 675d778  
nothing to commit, working directory clean

Same problem with extras, HEAD is detached?

I thought the “git submodule update --init --recursive” would keep core and extra updated?

in ansible/modules/extras

$ git pull origin devel  
From [https://github.com/ansible/ansible-modules-extras](https://github.com/ansible/ansible-modules-extras)

- branch devel → FETCH\_HEAD  
Updating 675d778…77eee2b  
Fast-forward  
.travis.yml | 2 ±  
cloud/amazon/GUIDELINES.md | 5 +  
cloud/cloudstack/cs\_template.py | 17 ++  
cloud/vmware/vmware\_datacenter.py | 2 +  
messaging/rabbitmq\_user.py | 2 ±  
monitoring/monit.py | 5 ±  
network/f5/bigip\_monitor\_http.py | 15 ±  
network/f5/bigip\_monitor\_tcp.py | 17 ±  
network/f5/bigip\_node.py | 17 ±  
network/f5/bigip\_pool.py | 15 ±  
network/f5/bigip\_pool\_member.py | 18 ±  
network/f5/bigip\_virtual\_server.py | 16 ±  
notification/hipchat.py | 5 ±  
packaging/language/maven\_artifact.py | 8 ±  
packaging/os/homebrew\_cask.py | 42 ++±  
packaging/os/zypper.py | 425 ++++++++++++++++++±---------------  
16 files changed, 396 insertions(+), 215 deletions(-)

I’ve used [How can I reconcile detached HEAD with master/origin?](http://bit.ly/1WaI83Y) to fix up the “HEAD detached” but why does clean clone from github put things into “HEAD detached” state?

Why doesn’t the “git submodule update --init --recursive” keep the modules up today?

I’m guessing the “HEAD detached” might be the reason “git submodule update --init --recursive” doesn’t keep the modules up today.

For many months I thought I’ve been keeping my local repository tracking github with this series of commands:

$ git pull --rebase  
$ git submodule update --recursive --init

Is that still the best way to track devel branch on github?

I’ll admit I’m a git newbie so any help would be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [May 5, 2016, 5:47pm UTC](https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365/2 "2016-05-05T17:47:45Z")

</div>

Using [How can I reconcile detached HEAD with master/origin?](http://stackoverflow.com/questions/5772192/how-can-i-reconcile-detached-head-with-master-origin) to fix the “HEAD detached” the extra modules I’m told:

Your branch is behind ‘origin/devel’ by 17 commits, and can be fast-forwarded.  
(use “git pull” to update your local branch)

(ansible.git)tanner@alliance:extras$ git pull  
Updating 675d778…77eee2b  
Fast-forward  
.travis.yml | 2 ±  
cloud/amazon/GUIDELINES.md | 5 +  
cloud/cloudstack/cs\_template.py | 17 ++  
cloud/vmware/vmware\_datacenter.py | 2 +  
messaging/rabbitmq\_user.py | 2 ±  
monitoring/monit.py | 5 ±  
network/f5/bigip\_monitor\_http.py | 15 ±  
network/f5/bigip\_monitor\_tcp.py | 17 ±  
network/f5/bigip\_node.py | 17 ±  
network/f5/bigip\_pool.py | 15 ±  
network/f5/bigip\_pool\_member.py | 18 ±  
network/f5/bigip\_virtual\_server.py | 16 ±  
notification/hipchat.py | 5 ±  
packaging/language/maven\_artifact.py | 8 ±  
packaging/os/homebrew\_cask.py | 42 ++±  
packaging/os/zypper.py | 425 ++++++++++++++++++±---------------  
16 files changed, 396 insertions(+), 215 deletions(-)

And now (example) the zypper.py file matches what I’m seeing on github

$ git log --follow zypper.py

commit bb68df525c78c48951cd925b5982c9dff45222fb  
Author: Robin Roth \<robin-roth@\*\*\*\*\*\*\*\*.de\>

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 5, 2016, 6:31pm UTC](https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365/3 "2016-05-05T18:31:16Z")

</div>

You can generally expect your submodules to always be in a detached head state.

The submodules are pinned to specific commits, so when you update your submodules, it will check out an individual commit, rather than devel.

Once the submodules are bumped, which happens about once a week, you will see new updates.

If you checkout devel in the submodules, then a git status would tell you have unstaged changes to the submodules commit sha references.

---

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [May 5, 2016, 8:29pm UTC](https://forum.ansible.com/t/correct-way-to-get-ansible-and-modules-from-github-and-how-to-keep-it-tracking-devel/21365/4 "2016-05-05T20:29:07Z")

</div>

To summarize, I’m not doing anything wrong?

Just need to wait until submodules to get bumped and I’ll see them?

Further, my commands to keep current are correct?

$ git pull --rebase  
$ git submodule update --recursive --init
