Git Autofetch

Git Autofetch is a simple software for fetching new changes from a repo to local repositories after a set time interval.

This program is responsible for checking the remote repo for changes and updating the local copy of the repo after a set delay (can be set in configs file later)

INSTALLATION

  1. Clone this repo.

git-clone

  1. cd into the repo

cd-git-autofetch

  1. Run the install.py. This is important to create important files, and create paths dynamically.

    run python3 install.py

    This will create 3 files which are :

    S. No File Name Purpose
    1 configs.py Basic Configuration (Delay)
    2 projectlist.py To store the list of projects to update (local folder path)
    3 autofetch.service Service file to tell systemd to run our program in background

install

  1. Register Projects in the newly created projectlist.py

    For registering projects, you are required to add a _Project object1 in the PROJECT_LIST2, which will be available in projectlist.py file. You can give name, url and local path of the project as parameters to object.

    1. To create objects the syntax is as follows :

        _Project(
            path=/path/to/git/project/folder
        ),
    

    2. Do remember to add a comma after previous _Project object, or else it will give errors. [see below image line:7]

edit-projectlist

  1. Move the newly created autofetcher.service to systemd's folders.

    run sudo mv autofetch.service /lib/systemd/system/

register-service

  1. Reload the systemd daemon.

    run sudo systemctl daemon-reload

daemon-reload

  1. Start the service autofetcher.service

    run sudo systemctl start autofetcher

start-service

  1. Check the status of autofetcher service

    run sudo systemctl status autofetcher

status-service

  1. (optional) Enable the service autofetcher

    run sudo systemctl enable autofetcher

And you will have your autofetcher running.


GitHub

https://github.com/Shreyas-Ashtamkar/git-autofetch