Auto Git Bot is a small shell executable file UNIX which can not only automate the task of adding files to pushing them to your repo but also can make a your own private cloud storage (make a private repo and push your files) !!
Read More at Medium Blog
CREDITS: Crio.Do- The Shell Script in Liunx using inotify-tools monitors the folder continuously.
- After changes saved, automatically git commands run and push to your repo.
- Voila !! All your files automatically backupd to Git's repo and with a timestamp !!
Important: Make sure to configure SSH Keys to Your Terminal and Git Service to avoid authentication of credentials in future.
-
First, fork this AutoGitBot and change its name (make it as private repo for personal files) !!
-
Open your terminal and install git using the command below.
-
sudo apt-get install git
-
Configure your remote repo with SSH Keys.
-
For GitHub Tutorial is given in the below section.
-
Can check here for GitLab 👉 https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html
-
Then clone that repo to your computer.
-
Install inotify-tools tools using the command below.
-
sudo apt-get install inotify-tools
-
Then use a code editor and change the path variable in the file.
-
Also configure username and email using commands below.
-
git config --global user.name "Your Name"
-
git config --global user.email "youremail@yourdomain.com"
-
Then start the script using the command in the terminal as shown below.
-
./watchBot.sh
-
That's it and you will be treated with a window as shown above !!
-
To turn off the service use Ctrl+Z
-
Copy the SSH key to your clipboard which was generated.
-
Then in the upper-right corner of any page, click your profile photo, then click Settings.
-
In the user settings sidebar, click SSH and GPG keys.
-
Click New SSH key or Add SSH key.
-
In the "Title" field, add a descriptive label for the new key.
-
Paste your key into the "Key" field.
-
Click Add SSH key.
-
If prompted, confirm your GitHub password.
(Source: GitHub Docs)
- Git
- inotify-tools
After Learning at Crio.Do's #ibelieveindoing Micro Experience, they encouraged us to put those new learned skills to work !! Thus decided to make this AutoGitBot !!