# git clone error "directory is not empty "

**URL:** <https://forum.ansible.com/t/git-clone-error-directory-is-not-empty/20455>\
**Category:** Ansible Project\
**Created:** [February 4, 2016, 4:50pm UTC](https://forum.ansible.com/t/git-clone-error-directory-is-not-empty/20455 "2016-02-04T16:50:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_Warrich](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Ali\_Warrich](https://forum.ansible.com/u/Ali_Warrich)\
**Post date:** [February 4, 2016, 4:50pm UTC](https://forum.ansible.com/t/git-clone-error-directory-is-not-empty/20455/1 "2016-02-04T16:50:09Z")

</div>

I am trying to clone from git private repo. I have done all the other steps but when it reaches to pull sources from git, I suddenly got error that /var/www/ directory is not empty. I donot know how to tackle this issue. Here is the chunk of code where I am facing error:

- name: Pull sources from GitHub  
git:  
repo: “{{ item.github\_repo }}”  
version: “{{ item.github\_branch }}”  
dest: “{{ WEB\_ROOT }}/{{ item.server\_name }}”  
key\_file: “/home/brokergenius/.ssh/id\_rsa”  
force: yes  
recursive: no  
when: item.get(‘state’, ‘link’) == ‘link’  
with\_items: VIRTUAL\_HOSTS

And error is:

TASK: [github | Pull sources from GitHub] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [158.69.201.193] =\> (item={‘state’: ‘link’, ‘http\_port’: 80, ‘github\_branch’: ‘master’, ‘server\_name’: ‘158.69.201.193’, ‘github\_repo’: ‘git@github.com:davidandorf/pricecalculation\_pos.git’}) =\> {“cmd”: “/usr/bin/git clone --origin origin --branch master ‘’ /var/www/158.69.201.193”, “failed”: true, “item”: {“github\_branch”: “master”, “github\_repo”: “[git@github.com](mailto:git@github.com):davidandorf/pricecalculation\_pos.git”, “http\_port”: 80, “server\_name”: “158.69.201.193”, “state”: “link”}, “rc”: 128}  
stderr: fatal: destination path ‘/var/www/158.69.201.193’ already exists and is not an empty directory.

msg: fatal: destination path ‘/var/www/158.69.201.193’ already exists and is not an empty directory.

I have tried to empty that file manually and then i tried to run it again but i got the same error again.  
Is there any solution to help me out guys??
