This is a simple software for fetching new changes to remote repositories automatically.
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)
Clone this repo.
cd into the repo
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 |
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
]
Move the newly created autofetcher.service to systemd's folders.
run sudo mv autofetch.service /lib/systemd/system/
Reload the systemd daemon.
run sudo systemctl daemon-reload
Start the service autofetcher.service
run sudo systemctl start autofetcher
Check the status of autofetcher service
run sudo systemctl status autofetcher
(optional) Enable the service autofetcher
run sudo systemctl enable autofetcher
And you will have your autofetcher running.
In case of issues, please open an issue. Describe the following :