gsync
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
About The Project
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.
Why linking config files ?
- Suppose you wanna sync your .bashrc in
~/, you will have togit inityour~/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
Getting Started
To get a local copy up and running follow these simple steps.
Prerequisites
You will need to install the following dependencies for the project to work.
fswatchfor macOS;inotify-toolsfor GNU+Linuxgitgit config pull.rebase true git config credential.helper storeghgh auth login gh auth refresh -h github.com -s delete_repo
Installation
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
Usage
- 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
createmode, edit your configuration file(config.filehere), 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.
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Changelog
v1.3
Added or Changed
-
Completely new and robust logic for syncing changes
- Can sync changes even when done with GUI and CLI, by any process - Leaves no dangling process. -
Support for automatically starting the monitoring process on login
-
Elaborative and colorful logs in a separate log-file, cleared on every login
-
Super convenient logs and process/service management
-
Service management is more binocular, supports starting and stopping of individual processes specified by user
-
Also included
enableanddisablemodes for services
Removed
-aargument. No need for any alias now, edit however you want- Old one way method of editing and syncing files
- Shell dependency
License
Distributed under the BSD-2-Clause License. See LICENSE.txt for more information.
Contact
Arpit Bhardwaj - Twitter - Telegram - proffapt@protonmail.com
Company website: Cybernity - CybernityForum
Project Link: https://github.com/proffapt/gsync