Script for GIT update

1

I have a question and I do not know how to solve it. It happens the following, I created a script in sh called atualiza.sh inside it I have the following code.

git add .
git commit -m"atualiza rotina"
git push
xxxxxxxxxxx

My goal is to run a routine every day that automatically updates any changes in git and sends it to my versioning server. Only when the routine executes this sh file I created nothing happens. Can anyone tell me what the error is?

    
asked by anonymous 07.12.2016 / 12:44

1 answer

1

Try the following

Create a script like this

#!/bin/bash

cd /home/{user}/localDoScript/atualiza.sh 
/usr/bin/git add -A 
/usr/bin/git commit -am "Atualiza rotina'date'"
/usr/bin/git push

In cron add it to run daily at the desired time

* 22 * * * cd /home/{user}/localDoScript/ && ./atualiza.sh

In this case every day at 10 p.m.

    
22.12.2016 / 19:13