# Issue when pushing with git in ignition 8.1 gateway event scrips

**URL:** <https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 19, 2023, 1:35pm UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644 "2023-04-19T13:35:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew\_fitzpatrick](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andrew\_fitzpatrick](https://forum.inductiveautomation.com/u/andrew_fitzpatrick)\
**Post date:** [April 19, 2023, 1:35pm UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644/1 "2023-04-19T13:35:33Z")

</div>

Im having an issue when pushing using the git-auto-commi.bat

The gateway event on save execute the script and does every steps but does not push, i have tried to do it in pyhton script or in a .bat file.

The issue is that when i use a script console the push line is executed but not on a gateway event

here is the code i used:  
path="C:\Program Files\Inductive Automation\Ignition\data\projects"  
gitpath="C:\Program Files\Git\cmd\git.exe"  
import time   
try:  
logger = system.util.getLogger("myLogger")  
system.util.execute([gitpath,"config","--global","user.name","'username"])  
system.util.execute([gitpath,"[config","--global","user.email","email@email.com](mailto:config%22,%22--global%22,%22user.email%22,%22email@email.com)"])  
system.util.execute([gitpath,"config","--global","user.password","password"])  
system.util.execute([gitpath,"-C",path,"add","."])  
system.util.execute([path+"\git-auto-commit.bat"])  
time.sleep(5)  
dateStr=str(system.date.now())  
system.util.execute([gitpath,"-C",path,"commit","-m","Designer save @ "+dateStr])  
time.sleep(10)  
system.util.execute([gitpath,"-C",path,"push origin"])  
logger.info("git update done!")  
except Exception as e:  
logger.infof("error, errorMsg: \n",e)

And this the scripot from the .bat file:

cd "C:\Program Files\Inductive Automation\Ignition\data\projects  
git config --global user.name "username"  
git config --global user.email "email"  
git config --global user.password "password"  
git add .  
git commit -m "Designer saved"  
git push origin

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 19, 2023, 1:49pm UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644/2 "2023-04-19T13:49:11Z")

</div>

In one call to `system.util.execute()`, your first argument is `gitpath`. In the other call (push), your first argument is `path`. Hmmm?

---

<div class="post-metadata">

**Author:** ![andrew\_fitzpatrick](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andrew\_fitzpatrick](https://forum.inductiveautomation.com/u/andrew_fitzpatrick)\
**Post date:** [April 19, 2023, 2:21pm UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644/3 "2023-04-19T14:21:41Z")

</div>

> [@pturmel](#):
>
> e call to `sys`

Yes, this is my mistake i have corrected it and i still have the issue

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 19, 2023, 2:32pm UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644/4 "2023-04-19T14:32:46Z")

</div>

Pushing across a network likely requires the service to run under an account that isn't `LOCAL_SYSTEM` to have sufficient privileges. Consider using java's `ProcessBuilder` instead of `system.util.execute()` so you can recover the `stdout` and `stderr` of the process and inspect that output for errors. (You can also obtain git's result code, and for the working commit, use the process completion status to drive progress in your script instead of an **evil** `.sleep()` call.)

---

<div class="post-metadata">

**Author:** ![diamond](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@diamond](https://forum.inductiveautomation.com/u/diamond)\
**Post date:** [June 5, 2024, 8:06am UTC](https://forum.inductiveautomation.com/t/issue-when-pushing-with-git-in-ignition-8-1-gateway-event-scrips/72644/5 "2024-06-05T08:06:20Z")

</div>

Hello Andrew,

Did you managed to solve this problem? I am stuck in the same thing.

Thanks
