{"id":19365371,"url":"https://github.com/jsdw/git-backup","last_synced_at":"2025-04-23T14:31:20.501Z","repository":{"id":93343309,"uuid":"207006628","full_name":"jsdw/git-backup","owner":"jsdw","description":"A tool to help you backup your git repositories from services like GitHub","archived":false,"fork":false,"pushed_at":"2019-10-16T13:22:00.000Z","size":96,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T15:51:12.445Z","etag":null,"topics":["backup","cli","git-backup"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsdw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-07T18:01:38.000Z","updated_at":"2022-06-18T14:28:08.000Z","dependencies_parsed_at":"2023-04-25T11:16:13.604Z","dependency_job_id":null,"html_url":"https://github.com/jsdw/git-backup","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdw%2Fgit-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdw%2Fgit-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdw%2Fgit-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdw%2Fgit-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdw","download_url":"https://codeload.github.com/jsdw/git-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250451710,"owners_count":21432877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cli","git-backup"],"created_at":"2024-11-10T07:39:59.793Z","updated_at":"2025-04-23T14:31:20.496Z","avatar_url":"https://github.com/jsdw.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jsdw/git-backup.svg?branch=master)](https://travis-ci.org/jsdw/git-backup)\n\n# git-backup\n\nA tool to backup all of your personal git repositories from one of the following sources:\n\n- GitHub (either repositories or gists)\n- GitLab\n- Bitbucket\n\nThe motivation behind this is that as you acquire more git repositories, and work on different repositories across different machines over a period of time, it's less and less likely that you'll have an uptodate copy of all of your repositories stored in one place (except in the cloud with the git service). This tool makes it easy to obtain a local copy of everything you have on such services so that you can store a backup of them yourself. One use case is running the tool on a self hosted backup server as part of a cron job to maintain uptodate copies of your repositories, or alternatively you might just run it on your local machine periodically to ensure that you have access to the latest version of everything.\n\nTo use this tool, you'll need a `token` from the service you want to backup your repositories from (see 'Obtaining a token', below).\n\n# Examples\n\nThese examples assume that we've installed this tool to somewhere on our `$PATH` (see 'Installing', below).\n\nFirst, we'll make our `token` available to `git-backup` (this can also be provided via the `--token` flag):\n\n```sh\nexport GIT_TOKEN=youraccesstokenhere\n```\n\nNow, we can back things up by providing a source and destination, like so:\n\n```sh\n# backing up all repositories from github\n# (all of the below and more are fine):\ngit-backup github/jsdw ~/path/to/backups\ngit-backup git@github.com/jsdw ~/path/to/backups\ngit-backup https://github.com/jsdw ~/path/to/backups\n\n# backing up all gists from github\n# (all of the below and more are fine):\ngit-backup gist.github/jsdw ~/path/to/backups\ngit-backup https://gist.github.com/jsdw ~/path/to/backups\n\n# backing up all repositories from gitlab\n# (similar formats to the above are accepted):\ngit-backup gitlab/jsdw ~/path/to/backups\n\n# backing up all repositories from bitbucket\n# (similar formats to the above are accepted):\ngit-backup bitbucket/jsdw ~/path/to/backups\n```\n\nYou can also use this via the `git` command (just remove the hyphen):\n\n```sh\ngit backup github/jsdw ~/path/to/backups\n```\n\n# Installing\n\n## From pre-built binaries\n\nPrebuilt compressed binaries are available [here](https://github.com/jsdw/git-backup/releases/latest). Download the compressed `.tar.gz` file for your OS/architecture and decompress it (on MacOS, this is automatic if you double-click the downloaded file).\n\nIf you like, you can download and decompress the latest release on the commandline. On **MacOS**, run:\n\n```sh\ncurl -L https://github.com/jsdw/git-backup/releases/download/v0.2.0/git-backup-v0.2.0-x86_64-apple-darwin.tar.gz | tar -xz\n```\n\nFor **Linux**, run:\n\n```sh\ncurl -L https://github.com/jsdw/git-backup/releases/download/v0.2.0/git-backup-v0.2.0-x86_64-unknown-linux-musl.tar.gz | tar -xz\n```\n\nIn either case, you'll end up with a `git-backup` binary in your current folder. The examples assume that you have placed this into your `$PATH` so that it can be called from anywhere.\n\n## From Source\n\nYou must have a recent version of `rust` installed (see [rustup](https://rustup.rs/)) to do this.\n\nGiven this, just run:\n\n```sh\ncargo install --git https://github.com/jsdw/git-backup.git --tag v0.2.0\n```\n\nTo install the latest released binary into your `PATH`. You may need to add `--force` if you have already installed a rust binary (for example, a prior version of this tool) with the same name.\n\nYou can also install the latest `master` branch by cloning this repository and running `cargo install --path .` in its root.\n\n# Obtaining a token\n\nYou'll need a token which you can provide using `--token` or the environment variable `GIT_TOKEN` in order to use this tool. This token will be used to obtain a list of repositories to backup (including private ones) and give the `git` CLI tool access to your repositories to clone/sync them locally.\n\nHere's how to get a token depending on the service you wish to backup from:\n\n## GitLab\n\nIn GitLab, you'll need to create a new *Personal Access Token* with the `api` scope.\n\nNavigate to *Settings -\u003e Access Tokens* to create one, and you'll need to tick the `api` scope.\n\n## GitHub\n\nGitHub also has a notion of a *Personal Access Token*.\n\nNavigate to *Settings -\u003e Developer Settings -\u003e Personal Access Tokens -\u003e Generate new token*.\n\nFor standard repositories you'll need to tick the `repo` scope. If you want to backup all of your gists, you'll also need the `gist` scope (otherwise only public gists will be backed up).\n\n## Bitbucket\n\nBitbucket has a concept called *App passwords*, which is what you'll need to provide to this backup tool.\n\nTo obtain one, navigate to *Profile -\u003e Settings -\u003e App passwords -\u003e Create App Password*. Tick the `read` scope under the `Repositories` heading.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdw%2Fgit-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdw%2Fgit-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdw%2Fgit-backup/lists"}