This script was created to make my job easier when working on a server that has not yet implemented version control automation. Where this can helps me to updated sources regularly from the git repository to the server.
Embedding other commands such as stdout
, ts
, etc. when running git fetch
and git pull
command. So the output of each git
command can be saved in html file. Then you can see the log results via your domain name without having to log in to your server.
Make sure you can execute basic git
commands manually (without error) to your existing repository.
- Clone this repository to your
home_directory
.git clone https://github.com/hadymaggot/git-logs.git /home/[user]/git-logs #change the path with yours
- Go to
/home/[user]/git-logs
andCopy
the demo directory to yourweb_root
.cd /home/[user]/git-logs/ #change the path with yours
cp -r demo/ /var/www/domain.tld/demo/
- Create a job for exec the
log.sh
every 10 minutescrontab -e
0,10,20,30,40,50 * * * * sh /home/[user]/git-logs/log.sh #change the path with yours