# Git clone failing

**URL:** <https://forum.ansible.com/t/git-clone-failing/16417>\
**Category:** Ansible Developer\
**Created:** [October 3, 2014, 2:54pm UTC](https://forum.ansible.com/t/git-clone-failing/16417 "2014-10-03T14:54:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 3, 2014, 2:54pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/1 "2014-10-03T14:54:51Z")

</div>

Brand new clone of ansible git project:

&nbsp;&nbsp;git clone --recursive [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)

Fails with the following error:

fatal: reference is not a tree: f624689bad24cb3a7b2ef43d5280b5f4fbabb5bd  
Unable to checkout 'f624689bad24cb3a7b2ef43d5280b5f4fbabb5bd' in  
submodule path 'lib/ansible/modules/core'

Not sure why this is failing as I've been able to clone and pull since  
the module split. This just started happening this morning.

---

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [October 3, 2014, 4:19pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/2 "2014-10-03T16:19:40Z")

</div>

Got the same thing, lazy workaround for now, commands at the ansible\_repo level -

rm -rf lib/ansible/modules/core  
cd lib/ansible/modules/  
git clone [https://github.com/ansible/ansible-modules-core.git](https://github.com/ansible/ansible-modules-core.git)

mv ansible-modules-core core  
cd ~/{your\_ansible\_repo)  
git submodule update --init lib/ansible/modules/extras

source and you should be good.

---

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [October 3, 2014, 4:22pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/3 "2014-10-03T16:22:11Z")

</div>

And a better fix is -

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

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [October 3, 2014, 4:27pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/4 "2014-10-03T16:27:43Z")

</div>

Hi Michael, I’m not getting the same result.

When I run: git clone --recursive [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git) test-clone, things seem to work fine:

Cloning into ‘test-clone’…  
remote: Counting objects: 68196, done.  
remote: Compressing objects: 100% (147/147), done.  
remote: Total 68196 (delta 78), reused 2 (delta 0)  
Receiving objects: 100% (68196/68196), 21.21 MiB | 1.01 MiB/s, done.  
Resolving deltas: 100% (42941/42941), done.  
Checking connectivity… done.  
Submodule ‘lib/ansible/modules/core’ (git://[github.com/ansible/ansible-modules-core.git](http://github.com/ansible/ansible-modules-core.git)) registered for path ‘lib/ansible/modules/core’  
Submodule ‘lib/ansible/modules/extras’ (git://[github.com/ansible/ansible-modules-extras.git](http://github.com/ansible/ansible-modules-extras.git)) registered for path ‘lib/ansible/modules/extras’  
Cloning into ‘lib/ansible/modules/core’…  
remote: Counting objects: 18738, done.  
remote: Compressing objects: 100% (20/20), done.  
remote: Total 18738 (delta 10), reused 2 (delta 0)  
Receiving objects: 100% (18738/18738), 5.25 MiB | 1.19 MiB/s, done.  
Resolving deltas: 100% (12495/12495), done.  
Checking connectivity… done.  
Submodule path ‘lib/ansible/modules/core’: checked out ‘cb69744bcee4b4217d83b4a30006635ba69e2aa0’  
Cloning into ‘lib/ansible/modules/extras’…  
remote: Counting objects: 18761, done.  
remote: Compressing objects: 100% (8/8), done.  
remote: Total 18761 (delta 4), reused 6 (delta 3)  
Receiving objects: 100% (18761/18761), 5.17 MiB | 557.00 KiB/s, done.  
Resolving deltas: 100% (12526/12526), done.  
Checking connectivity… done.  
Submodule path ‘lib/ansible/modules/extras’: checked out ‘8a4f07eecd2bb877f51b7b04b5352efa6076cce5’

So maybe something else is going on here?

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 3, 2014, 5:37pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/5 "2014-10-03T17:37:28Z")

</div>

It's working now. The exact same command was failing for me on  
multiple machines. Maybe a github hiccup...

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 3, 2014, 10:32pm UTC](https://forum.ansible.com/t/git-clone-failing/16417/6 "2014-10-03T22:32:10Z")

</div>

I fixed this myself earlier.

Apparently this is an issue with one of the checkouts having some commits which were not pushed, I don’t expect this to happen again, but it’s easily resolved by updating the submodules.

Thanks!
