PHPackages                             chsxf/git-repo-backup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. chsxf/git-repo-backup

ActiveLibrary

chsxf/git-repo-backup
=====================

0.9(3y ago)01MITPHPPHP &gt;=8.1

Since Jun 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/chsxf/git-repo-backup)[ Packagist](https://packagist.org/packages/chsxf/git-repo-backup)[ RSS](/packages/chsxf-git-repo-backup/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

About This Project
==================

[](#about-this-project)

`git-repo-backup` is a command-line tool to manage git repository backups.

At the moment, it works only with GitHub or BitBucket Cloud.

Conventions
-----------

[](#conventions)

This project uses [gitmoji](https://gitmoji.dev) for its commit messages.

Installation
============

[](#installation)

Requirements
------------

[](#requirements)

- [PHP](https://www.php.net/) 8.1+ with cURL extension enabled
- [Composer](https://getcomposer.org)

Installing with Composer
------------------------

[](#installing-with-composer)

### Installing Globally

[](#installing-globally)

We recommend installing this package globally.

```
composer global require chsxf/git-repo-backup

```

If not already, you need to add the global composer `bin` directory to your `PATH` environment variable.

### Installing Locally

[](#installing-locally)

But you can also install it locally if it better fits your setup.

```
composer require chsxf/git-repo-backup

```

The tool will be installed in the local `vendor` folder and the executable script can be called with the `vendor/bin/git-repo-backup` command.

Updating with Composer
----------------------

[](#updating-with-composer)

If installed globally, you can run `composer global update chsxf/git-repo-backup`.

If installed locally, simply run `composer update chsxf/git-repo-backup` in the folder where the tool was previously installed.

Usage
=====

[](#usage)

```
git-repo-backup
    --username
    --password
    --platform (github|bitbucket)
    --clone-protocol (https|ssh)
    [--no-git-lfs]
    [--dest-dir ]
    [--ssh-key ]
    [--exclude ]
    [--dry-run]
    [--sort-by (size|name) (asc|desc)]

```

Required Parameters
-------------------

[](#required-parameters)

ParameterDescription`username`**GitHub**: User name used to authenticate with the platform's API
**BitBucket Cloud**: Workspace (user or organization) for which to get repositories`password`See [Passwords](#passwords) section below`platform`Platform on which the repositories are hosted

Accepted values:
- `github`
- `bitbucket` (BitBucket Cloud)

`clone-protocol`Protocol to use when cloning/fetching the repositories

Accepted values:
- `ssh` (recommended)
- `https`

Optional Parameters
-------------------

[](#optional-parameters)

ParameterDescription`no-git-lfs`Skip availability test for Git LFS. Use this setting if you don't use Git LFS with any of your repositories.`dest-dir`Destination path to store the repository backups. If not set, the script stores backups in current working directory.`ssh-key`**Not supported on Windows**
Specific SSH key to use with repositories, useful if you have several SSH keys for the same domain.
The specific path will be passed to git commands thanks to the `core.sshCommand` config.
Ignored if `--clone-protocol` is set to `https``exclude`Comma-separated list of excluded repositories
Each entry can be either an exact match if containing only alphanumerical characters, hyphens and underscores, or a case-insensitive Perl-Compatible Regular Expression otherwise`dry-run`If present, no clone or fetch/pull operation is done, and only repositories information are reported`sort-by`Specify how repositories are sorted before being processed.
Repositories can be sorted by `name` (default) or by `size`.
Order can ascending (`asc` - default) or descending (`desc`).

Accepted values:
- `name asc`
- `name desc`
- `size asc`
- `size desc`

Passwords
---------

[](#passwords)

The `password` value differs from one platform to another.

On GitHub, the password must be a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

On BitBucket Cloud, the password must be an [app password](https://bitbucket.org/account/settings/app-passwords/).

Planned Improvements
====================

[](#planned-improvements)

- Support GitHub organizations
- Allow the use of a configuration file

License
=======

[](#license)

This repository is distributed under the [MIT License](LICENSE).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1438d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a637a6c91b12634e1f2c9e402d92bca89516780fa228d72c5a255dae9ebd1cfa?d=identicon)[chsxf](/maintainers/chsxf)

---

Top Contributors

[![chsxf](https://avatars.githubusercontent.com/u/3322862?v=4)](https://github.com/chsxf "chsxf (21 commits)")

---

Tags

backupbackup-utilitybitbucketgitgithubphp

### Embed Badge

![Health badge](/badges/chsxf-git-repo-backup/health.svg)

```
[![Health](https://phpackages.com/badges/chsxf-git-repo-backup/health.svg)](https://phpackages.com/packages/chsxf-git-repo-backup)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
