Coder Social home page Coder Social logo

gist-backup's Introduction

gist-backup โ€“ Creates a backup of all your gist repos

This Bash script backs up your public and private gists to a given directory as git repositories including the full revision history. If the directories already exist, the gist repos will be updated. It's all implemented as a simple Bash script. It probably breaks if you have a lot of gists. Also, watch out for rate limiting. This version was forked and archiving + compression feature was added.

Setup

Because this script backs up your private repos, not just your public ones, you'll need to generate an OAuth token. This will also include write access to your gists although the script does not use it! Here is how you can request the API token:

$ curl -u github-user-name:github-password \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"scopes":["gist"], "note": "gist backup"}' \
  https://api.github.com/authorizations

Your account password is required here because v3 of the API is not accessible with your account token.

Take the token given in the response and set it in your git config as github.gist.oauth.token.

$ git config --global github.gist.oauth.token TOKEN

You can revoke this token at any time by visiting https://github.com/settings/applications.

Usage

When you have set the gist token as described above, you can start backing up all your gists using the following commands:

$ gist-backup -d ~/gist-backups [-t token]
$ gist-backup -ab archive.tar.bzip2 [-t token]
$ gist-backup -ag archive.tar.gzip [-t token]

For the -d option, when you call the script again, it will simply update the repos (pull changes) if they exist already.

gist-backup's People

Contributors

aprescott avatar cmcdragonkai avatar intarstudents avatar pklaus avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.