# Can i automate "pushing" commits to remote github repository?

**URL:** <https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479>\
**Category:** General\
**Created:** [2 October 2022 04:56 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479 "2022-10-02T04:56:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaroneisele55](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aaroneisele55/32/65335_2.png) [@Aaroneisele55](https://discourse.nodered.org/u/Aaroneisele55)\
**Post date:** [2 October 2022 04:56 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/1 "2022-10-02T04:56:01Z")

</div>

Hello,  
I'm using the projects feature and I want to automatically push my changes to my remote repository, which is on github (like "if there is a new local commit, push that to github")  
How can i do that?

Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 October 2022 13:30 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/2 "2022-10-02T13:30:25Z")

</div>

Maybe periodically run a git command to check for new commits and if found push to upstream.

---

<div class="post-metadata">

**Author:** ![Aaroneisele55](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aaroneisele55/32/65335_2.png) [@Aaroneisele55](https://discourse.nodered.org/u/Aaroneisele55)\
**Post date:** [2 October 2022 16:37 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/3 "2022-10-02T16:37:08Z")

</div>

What would that git command be?  
I'm a total noob in git and only know the `git clone` command.

EDIT:  
I did it using this script which i put in crontab to run every minute.

```auto
cd /home/pi/.node-red/projects/nodered
git push

```

Thanks for your help  
Aaron

---

<div class="post-metadata">

**Author:** ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)\
**Post date:** [3 October 2022 12:45 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/4 "2022-10-03T12:45:33Z")

</div>

Just like we have an option to do an automatic commit, IMHO we should also have an option to do an automatic push.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [3 October 2022 14:56 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/6 "2022-10-03T14:56:28Z")

</div>

Not specific to Node-RED, it is possible to configure any git repo to push after a commit.

> <https://stackoverflow.com/questions/7925850/how-can-i-automatically-push-after-committing-in-git/7925891#7925891>

Your project's git repository is under `~/.node-red/projects/<project-name>`

---

<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:** [17 October 2022 14:56 UTC](https://discourse.nodered.org/t/can-i-automate-pushing-commits-to-remote-github-repository/68479/7 "2022-10-17T14:56:47Z")

</div>

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