Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spenserblack/change-git-user
Manage multiple git configurations
https://github.com/spenserblack/change-git-user
git git-config git-configuration git-user rust
Last synced: 4 days ago
JSON representation
Manage multiple git configurations
- Host: GitHub
- URL: https://github.com/spenserblack/change-git-user
- Owner: spenserblack
- License: mit
- Archived: true
- Created: 2020-11-20T13:11:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T14:15:24.000Z (4 months ago)
- Last Synced: 2025-02-09T01:33:44.082Z (12 days ago)
- Topics: git, git-config, git-configuration, git-user, rust
- Language: Rust
- Homepage:
- Size: 155 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `cgu`
[][Crates.io Link]

Manage multiple git configurations
Inspired by [Git-User-Switch](https://github.com/geongeorge/Git-User-Switch).
## :warning: Archival Notice
I've switched to just using [`includeIf`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-includeIfltconditiongtpath)
in my `.gitconfig`. Honestly, this works a lot better for me than having to constantly switch users via this command.## Installation
```bash
# this will install the executable `cgu` and `git-change-user`
cargo install change-git-user# enable only the cli
cargo install --no-default-features --features=cli change-git-user# enable only prompts
cargo install --no-default-features --features=prompts change-git-user
```## Features
- Switch `user.name` and `user.email` config
- Assign an optional `user.signingKey` to the config
- Give the config a name to remember it by (e.g. "Work" or "Personal")
- Uses `git2` to discover a repository and manipulate its config## Usage
***NOTE*** You can use `cgu` and `git change-user` interchangeably.
### Prompts
```bash
# This will spawn prompts to guide you through managing user configurations
cgu
```### CLI
If you don't want use use prompts, you can use subcommands instead.
The subcommands are:- `add`
- `select`
- `delete`
- `view`#### Examples
```bash
# view CLI options
cgu --help# view subcommand help
cgu --help# Add a config with the name "My Config"
# Defaults to the user.name value ("My Name" in this example) if --name is not passed
cgu add --name "My Config" "My Name" [email protected]# View all configs
cgu view --all# Select the new config
cgu select "My Config"# Delete the new config
cgu delete "My Config"
```[Crates.io Link]: https://crates.io/crates/change-git-user