Note I have lost interest in bash at this point of time, been doing this too much that it has become toxic for my health and career, so this project is being discontinued from my side. And, this project was a fun project - rather use cronjobs to achieve what it was doing
¯\_(ツ)_/¯
. It won't have all the logs and service like features but those aren't needed anyways, if they are anyhow then you always have this tool available right here.
Automate the unique process(by me) for syncing your configuration from your local machine to github.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
GSYNC is a tool for those who like to sync their configuration files in real-time to github, so how does it exactly do that? Read the code for detailed understanding.. from v1.2.1 it can be managed as if it is a kind of a service and has beautiful logs for every folder being monitored
TIP: Use it as a editor alias to open your fav editor and create your configuration file, it will do the job of syncing it to your github and automate this process for future use after you are done editing it.
- Suppose you wanna sync your .bashrc in
~/
, you will have togit init
your~/
which will show everywhere(main)
in your terminal and might clash with your sub directories which are some local git projects, so yeah just move it somewhere else.. link that to original location and sync the file now
To get a local copy up and running follow these simple steps.
You will need to install the following dependencies for the project to work.
fswatch
for macOS;inotify-tools
for GNU+Linuxcoreutils
git
git config pull.rebase true git config credential.helper store
gh
gh auth login gh auth refresh -h github.com -s delete_repo
Now since we are done with the setting up of environment suitable for the project to compile/run, let's install and configure the project on your system locally now.
- Clone the repo.
- Make the script executable.
- Add suitable alias for it.
git clone https://github.com/proffapt/gsync.git cd ./gsync chmod +x ./gsync echo "alias gsync='$PWD/gsync'"
- Add the echoed line to your shell config file.
- Finally, source your config file
- Execute the help menu for script
gsync
- Use cases for the script are as follows:
-
Create mode
gsync create -c ~/config.file -g ~/configs
-
Delete mode
gsync delete -c ~/config.file -g ~/configs
-
Default mode
gsync default -g ~/configs gsync create -c ~/config.file gsync delete -c ~/config.file
-
Logs management
gsync clear-logs -g ~/configs gsync clear-logs -g configs gsync clear-logs -g all gsync logs -g ~/configs gsync logs -g configs gsync logs
-
Service management
gsync start gsync selective-start gsync stop gsync selective-stop gsync restart gsync status gsync enable gsync disable
-
[BONUS] Folder Syncing :)
gsync create -c ~/random.file -g ~/folder_to_sync rm ~/folder_to_sync/random.file ~/random.file
- Now if you used
create
mode, edit your configuration file(config.file
here), the syncscript will do it's job and sync the configuration file to specified github repo.
* See output screenshots of various cases in images folder.
📫 Arpit Bhardwaj ( aka proffapt ) -
- Choose an Open Source License
- Img Shields
- GH manual
- sed - BSD v/s GNU/Linux
- Detect changes in git folder
- Launchd - automate things at login for mac
Do consider looking at other paradigms of this documentation