# Auto-Pull GitHub project (API / CLI...)

**URL:** https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827
**Category:** General
**Created:** [13 November 2023 13:10 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827 "2023-11-13T13:10:55Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![rFond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rfond/32/84771_2.png) [@rFond](https://discourse.nodered.org/u/rFond)
#### Post date: [13 November 2023 13:10 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/1 "2023-11-13T13:10:55Z")

</div>

Hi,

It's possible to use Node Red API to execute a project pull ?  
My idea would be to have a recurring task that performs a pull of my Git project every day for exemple.

Thanks for your help.

---

<div class="post-metadata">

### Author: ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)
#### Post date: [13 November 2023 13:21 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/2 "2023-11-13T13:21:27Z")

</div>

Are you aware of this: [Projects : Node-RED](https://nodered.org/docs/user-guide/projects/)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 November 2023 13:24 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/3 "2023-11-13T13:24:28Z")

</div>

You could do it in an exec node.  
Note that if there are any changes you will need to restart node-red.

---

<div class="post-metadata">

### Author: ![rFond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rfond/32/84771_2.png) [@rFond](https://discourse.nodered.org/u/rFond)
#### Post date: [13 November 2023 13:29 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/4 "2023-11-13T13:29:55Z")

</div>

Do you have an exemple of this ?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 November 2023 13:58 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/5 "2023-11-13T13:58:59Z")

</div>

> [@rFond](#):
>
> Do you have an exemple of this

An example of what?

---

<div class="post-metadata">

### Author: ![rFond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rfond/32/84771_2.png) [@rFond](https://discourse.nodered.org/u/rFond)
#### Post date: [13 November 2023 14:07 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/6 "2023-11-13T14:07:49Z")

</div>

A flow exemple.  
But okay, I understand. I think you use Linux commands to do this (git pull).

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 November 2023 14:12 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/7 "2023-11-13T14:12:38Z")

</div>

Yes, git pull will fetch the latest from the repository. You will have to cd into the relevant directory first, so the command may be something like  
`cd /home/me/.node-red && git pull`

---

<div class="post-metadata">

### Author: ![rFond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rfond/32/84771_2.png) [@rFond](https://discourse.nodered.org/u/rFond)
#### Post date: [13 November 2023 14:56 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/8 "2023-11-13T14:56:02Z")

</div>

I've tested it, and okay, it works, but there are a problem. On reboot, I lose connection to GitHub. The solution was to create a 'git config credential.helper store,' but I'm not very fond of this solution.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 November 2023 15:17 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/9 "2023-11-13T15:17:41Z")

</div>

Set your repository up to use ssh keys.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [27 November 2023 15:17 UTC](https://discourse.nodered.org/t/auto-pull-github-project-api-cli/82827/10 "2023-11-27T15:17:52Z")

</div>

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