Giter Site home page Giter Site logo

gbck's Introduction

Gbck logo
Git Backup

Table of Contents

Introduction

Gbck is an intuitive lightweight tool for an easy and seamless backup of your files e.g. various config files. It's built to be an easy and flexible as possible. All you have to do is just to create the config file containing all files (and/or commands' stdouts) you desire to back up.

πŸ‘‰ Read gbckβ€” an easy way how to back up your dotfiles on Medium.com

Install

npm i -g gbck

Requirement: You need to have Node 7.5+ and Git installed on your machine

Usage

Usage: gbck [projects]

Options:
-i, --init                Create new project  
-f, --force               Along with -i create new project even if already exists
-l, --list                List all project sorted by its latest updates
-v, --version             Print version
-h, --help                Show this help
--auto-commit             Don't ask for commit message and use default one

Note: gbck stores every information under ~/.gbck

Create a new project

For a creation of a new project just run gbck --init.

You project will be saved inside ~/.gbck/<project-name>/

  • config
  • README.md
  • .vsc - the actual Git repository folder

If you use --force or -f option you will be able to rewrite already existing project.

Now it's time to configure it, so open a ~/.gbck/<project-name>/config and go on.

Check out this example configuration πŸ’ͺ

config has to be valid JSON:

  • Fields url: string, readme: string, entities: Array are mandatory.
  • Field syncConfig: boolean is optional and defaults to true.

next, entities has to be an array:

  • If the item is type of string it has to point to file or directory if so the file or directory will by backed up.

  • If the item is a type of array, the first item of that array is the final file name and the second item is the command which will be run and its stdout will be backed up into this file.

  • If the item is a type of object. The i:string and o:string property are mandatory, i is input file / folder, o is output name. There could be also options: object property defined. Possible options are:

    • noSymlinks: boolean, defaults to false
    • exclude: Array<glob> defaults to []
    • include: Array<glob> defaults to []
{
  "url": "[email protected]:jukben/dotfiles.git",
  "readme": "README.md",
  "syncConfig": false,
  "entities": [
    {
      "i": "~/.config/fish",
      "o": ".config/fish",
      "options": {
        "noSymlinks": true,
        "exclude": ["fishd.dca90476d2cf"]
      }
    },
    {
      "i": "~/Library/Application Support/Code/User/settings.json",
      "o": "vscode/settings.json"
    },
    "~/.tmux.conf",
    "~/.gitignore",
    "~/.vimrc",
    ["brew-cask.txt", "brew cask list"]
  ]
}

List available projects

Run gbck --list to see a list of available projects even with information when where lastly updated.

Back up a project

For back up all project just simply run gbck. If you want to back up particular project run e.g. gbck dotfiles private-dotfiles

If you run this command along with --auto-commit you won't be asked for a commit message. This could be good for some types of automatization.

Contributing

Do you miss something? Open an issue, I'd like to hear more about your use case. You can also fork this repository run yarn and send a PR! ❀️

Currently, tests are missing. πŸ˜₯ But you can help me to fix this!

License

The MIT License (MIT) 2018 - Jakub BeneΕ‘

gbck's People

Contributors

jukben avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.