Skip to content

Code01010/Auto-Git-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto-Git-Bot

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

What Does it Do Exactly ?

Blueprint of AutoGitBot Image

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 !!

Getting Started

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

    image

  • That's it and you will be treated with a window as shown above !!

  • To turn off the service use Ctrl+Z

Setting up SSH Keys for GitHub

  • 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)

Technologies Used

  • Git
  • inotify-tools

Story Behind It

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 !!

Supporting Link:

About

Built Auto Upload Cloud Storage Clone using Simple Shell Script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%