git-profile
Managing user.name
and user.email
can be cumbersome if you have multiple profiles.
git-profile
lets you create, manage, and switch between them with ease.
Optionally, you can also set user.signingkey
for signed commits.
The quickest way to get started is to run git profile import
and git profile apply <your-profile>
:
user.name=Git
user.email=smith@work.com
Installation
Cargo
If you haven't, install cargo
as follows:
|
Then, run the following command to install git-profile
:
(The actual executable will be named git-profile
.)
Usage
USAGE:
git-profile [OPTIONS] <SUBCOMMAND>
OPTIONS:
-c, --config-path <CONFIG_PATH> Use the given path to the configuration file to read/write
profiles
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
apply Apply the given profile
config-dump Dump the content of the config file
config-path Print path to the config file
current Show the key or value of the current profile
edit Edit an existing profile
help Print this message or the help of the given subcommand(s)
import Import the current git config values as a profile
list List all profiles
new Create a new profile
remove Remove a profile
rename Rename the given profile with the given new name
show Show the details of the given profile
Create a new profile
For a quick start, git profile import
allows you to import your existing profile:
user.name=Git
user.email=smith@work.com
Alternatively, you can manually create a new profile with the git profile new
command:
)
)
)
Use a profile
To switch between profiles, use the apply
subcommand:
Under the hood, this is equivalent to running the following command:
git-profile
supports the config level flags (--local
, --global
, --system
, --worktree
, and --file
) out of the box.
List existing profiles
list
gives you an overview of your profiles. *
indicates which profile is currently being activated.
Get the current profile key
current
gives you the key of the current profile:
Show attributes
Use show
to see the details of a profile:
user.name=Git
user.email=smith@github.com