First you generate ssh key in the server
- ssh-keygen -t rsa -b 4096 -C "asak999@gmail.com"
- Uploading this public key to deploy keys in GitHub
- Then you create /home/user/.ssh/config file
- Then you clone repository with git clone https://github.com/akilawickey/akilawickey.github.io.git
- create a bash file as sync.sh
- Give privilages to the script by chmod +x sync.sh
- And then put it in cronjob to make it happen peroidly
- just go to terminal and type crotab -e and edit it as following structure