# Pulling from git via the Execute Command (or SSH) node

**URL:** <https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338>\
**Category:** Questions\
**Tags:** ssh, execute-command\
**Created:** [Maio 18, 2023, 8:00pm UTC](https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338 "2023-05-18T20:00:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hndmn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hndmn/32/24182_2.png) [@hndmn](https://community.n8n.io/u/hndmn)\
**Post date:** [Maio 18, 2023, 8:00pm UTC](https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338/1 "2023-05-18T20:00:04Z")

</div>

I am attempting to do something which may not be possible, but I thought I would ask. I am self-hosting n8n via docker and am building a workflow that when triggered by a webhook would execute a ‘git pull’ command on my server (whether that be localhost or my production server) in order to pull fresh copies of all workflows into n8n. It will be a selective pull - I’ll modify git and the command if/when I figure out how to successfully run ANY command 🙂

My initial thought is to do this with the Execute Command node. What I’m failing to grasp is how to mount a volume in my docker-compose.yml file that would make my project directory visible to the command. In my n8n service config I’ve added a volume (found this on Stack Overflow) but I don’t know if it’s close or not to the right answer:

volumes:  
- ./var/run/docker.sock:/var/run/docker.sock

Here is just a current draft of the experiment.

When I change the command to ls, I get something as follows, which makes sense as it is the root level of the n8n container.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/e/b/ebaa875bde14614769e46d0a976f3a155173ef1e.png)

So I guess what I am asking is is there a way to allow the command node to reach into the root of my local development folder where the docker-compose.yml file resides so that I can pull from git?

If this is not possible/advisable, I was then thinking about running an SSH node instead. I can see how this would work in my production environment, but I don’t understand how/if it could work on my local developer instance on Docker in Windows.

Any ideas/suggestions would be welcome. Thank you!

## Information on your n8n setup

- **n8n version:** 0.221.2
- **Database (default: SQLite):** SQLite
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):** own
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Docker
- **Operating system:** Windows 11

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [Maio 22, 2023, 9:19am UTC](https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338/2 "2023-05-22T09:19:32Z")

</div>

Hey @hndmn,

So you would want to mount a proper folder rather than a socket, On your host create a folder lets assume your username is `hndmn` we would make a folder under `/home/hndmn/git` then we would mount that folder to the container under `/git` so the mount option would be `- /home/hndmn/git:/git` once that is done start up the container and testing can begin.

To test I would make a file on the host so run something like `touch /home/hndmn/git/test` to make an empty file then using the execute command node in n8n run `ls /git` and see if it returns the file. If that has worked you are good to go.

---

<div class="post-metadata">

**Author:** ![hndmn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hndmn/32/24182_2.png) [@hndmn](https://community.n8n.io/u/hndmn)\
**Post date:** [Maio 23, 2023, 3:50pm UTC](https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338/3 "2023-05-23T15:50:33Z")

</div>

Excellent. I’ll give this a try soon and report back.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [Agosto 21, 2023, 3:50pm UTC](https://community.n8n.io/t/pulling-from-git-via-the-execute-command-or-ssh-node/26338/4 "2023-08-21T15:50:59Z")

</div>

Fechado em Agosto 21, 2023, 3:50pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
