PHPackages                             stolt/git-user-bend - 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. [CLI &amp; Console](/categories/cli)
4. /
5. stolt/git-user-bend

ActiveLibrary[CLI &amp; Console](/categories/cli)

stolt/git-user-bend
===================

A utility tool for managing the Git user configuration.

v1.5.1(1y ago)4261[6 issues](https://github.com/raphaelstolt/git-user-bend/issues)MITPHPPHP &gt;=8.1CI passing

Since Apr 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/raphaelstolt/git-user-bend)[ Packagist](https://packagist.org/packages/stolt/git-user-bend)[ RSS](/packages/stolt-git-user-bend/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (7)Dependencies (8)Versions (17)Used By (0)

git-user-bend
=============

[](#git-user-bend)

[![Test](https://github.com/raphaelstolt/git-user-bend/workflows/test/badge.svg)](https://github.com/raphaelstolt/git-user-bend/workflows/test/badge.svg) [![Version](https://camo.githubusercontent.com/95519918966058b092623d6fff6c625ac8c5ab338b19cc11a3e8a5700ebdb4bd/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746f6c742f6769742d757365722d62656e642e7376673f7374796c653d666c6174)](https://packagist.org/packages/stolt/git-user-bend)[![PHP Version](https://camo.githubusercontent.com/e75ee3e54e01af4614fff6cca4b538e3da263832d751ee88abcf332c3174d3e5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312b2d6666363962342e737667)](https://camo.githubusercontent.com/e75ee3e54e01af4614fff6cca4b538e3da263832d751ee88abcf332c3174d3e5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312b2d6666363962342e737667)

The `git-user-bend` CLI is a utility tool for managing the Git user configuration (i.e. name and email) of a given Git repository. With it you can create a set of **personas** and easily **bend** them when doing company work, open source development, or **pair** programming sessions.

With the in Git `2.13` introduced [conditional configuration includes](https://git-scm.com/docs/git-config#_conditional_includes) you can set a `.gitconfig` for a group of repositories, which already might suit your needs.

#### Known relatives

[](#known-relatives)

This CLI is influenced by the [Gas](https://github.com/walle/gas) Ruby gem and might also contain elements of [pair](https://github.com/square/pair).

#### Installation

[](#installation)

The `git-user-bend` CLI should be installed globally through Composer.

```
composer global require stolt/git-user-bend
```

Make sure that the path to your global vendor binaries directory is in your `$PATH`. You can determine the location of your global vendor binaries directory via `composer global config bin-dir --absolute`. This way the `git-user-bend`executable can be located.

Since the default name of the CLI is quite a mouthful, an alias which can be placed in `~/.aliases`, `~/.zshrc` or the like might come in handy. The alias shown next assumes that `$COMPOSER_HOME` is `~/.config/composer` and not `~/.composer`.

```
alias gub='~/.config/composer/vendor/bin/git-user-bend $@'
```

Tip

As of release `v1.2.1` it's also possible to install and use `git-user-bend` via a PHAR [file](https://github.com/raphaelstolt/git-user-bend/releases/tag/v1.2.1).

Usage
-----

[](#usage)

Run the `git-user-bend whoami` CLI within a Git repository (or an argumented one) and it will allow you to view the currently used persona respectively the Git user configuration details.

The personas and their usage frequencies are stored in a JSON based global storage file called `.gub.personas` in the `$HOME` directory of your system.

Via a `.gub` dotfile it's also possible to add the details of **single** persona directly into a project repository. This is mostly oriented for repository maintainers working on multiple machines and with multiple personas. To keep your email address **private** consider using your `username@users.noreply.github.com` email address, for details see [Setting your email in Git](https://help.github.com/articles/setting-your-email-in-git/).

#### Available commands

[](#available-commands)

To create a new persona the `add` command is available. It allows you to define an alias linked to persona details, which are basically the username and email. Every added persona is stored in the global storage file.

```
git-user-bend add
git-user-bend add "oss" "Raphael Stolt" "raphaelstolt@users.noreply.github.com"
git-user-bend add "com" "Raphael Stolt" "raphael.stolt@company.com"
```

To create a persona from a local `.gub` dotfile, local Git repository user details, or from global Git user details the `import` command can be used. When a persona should be created from the Git user details its alias has to be provided.

```
git-user-bend import [] [] [--from-dotfile]
```

To create a local `.gub` dotfile from an existing persona the `export` command is available.

```
git-user-bend export  []
```

To remove a defined persona from the global storage the `retire` command can be used.

```
git-user-bend retire
```

To view all defined personas the `personas` command is at your service. Via the `--edit|-e` option the global storage file called `.gub.personas` will be editable via the defined `$EDITOR`.

```
git-user-bend personas [--edit|-e]
```

To bend the persona of a Git repository, the `use` command is there to change the Git user configuration to the aliased user details. When using the `--from-dotfile` option the persona defined in a `.gub` dotfile is used. When an aliased persona from the global storage should be used its alias has to be provided. When a pair should be used their aliases have to be provided as a comma-separated list.

```
git-user-bend use [|] [] [--from-dotfile]
```

To reset the Git repository user to the values before, the `reset` command is available.

```
git-user-bend reset []
```

To start a pair programming session, which will be identifiable in the Git commits, the `pair` command merges the user details of several personas into one pair. The email of the first persona alias in the comma-separated list will be used for the Git `user.email` configuration. If the `--branch|-b` is provided, a new Git branch will be created to pair in.

```
git-user-bend pair "" [] [--branch|-b]
```

To end a pair programming session and restore the default `user.name` and `user.email` the `unpair` command is available.

```
git-user-bend unpair
```

To check the persona, pair or respectively the Git user configuration of a repository the `whoami` command is a pleasant shortcut.

```
git-user-bend whoami []
```

#### Running tests

[](#running-tests)

```
composer test
```

#### License

[](#license)

This library and its CLI are licensed under the MIT license. Please see [LICENSE.md](LICENSE.md) for more details.

#### Changelog

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for more details.

#### Code of Conduct

[](#code-of-conduct)

Please see [CONDUCT.md](CONDUCT.md) for more details.

#### Contributing

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 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

Every ~178 days

Recently: every ~1 days

Total

16

Last Release

662d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/132faf5713fa951f4263fad02858a62e55c5d832ad775b33e49ba0cda2f2a028?d=identicon)[Raphael Stolt](/maintainers/Raphael%20Stolt)

---

Top Contributors

[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (90 commits)")

---

Tags

gitconfigrepository-managementrepository-utilitiesclidevconfigurationusergit

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stolt-git-user-bend/health.svg)

```
[![Health](https://phpackages.com/badges/stolt-git-user-bend/health.svg)](https://phpackages.com/packages/stolt-git-user-bend)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[projektgopher/whisky

A simple CLI tool for managing a project's git hooks across multiple members.

241281.3k20](/packages/projektgopher-whisky)[buggregator/trap

A simple and powerful tool for debugging PHP applications.

2591.7M40](/packages/buggregator-trap)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1862.1M27](/packages/dereuromark-cakephp-ide-helper)[laminas/laminas-cli

Command-line interface for Laminas projects

563.7M54](/packages/laminas-laminas-cli)[automattic/jetpack-changelogger

Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.

106.7M146](/packages/automattic-jetpack-changelogger)

PHPackages © 2026

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