MCPcopy Index your code
hub / github.com/dotzero/git-profile

github.com/dotzero/git-profile @v1.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.8.0 ↗ · + Follow
126 symbols 393 edges 31 files 66 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Git Profile

build MIT License

Git Profile helps you manage multiple Git identities and switch between them per repository.

Installation

Homebrew

brew install dotzero/tap/git-profile

Prebuilt binaries

Download a binary from the releases page and place it in a directory listed in $PATH.

Build from source

go install github.com/dotzero/git-profile@latest

The binary will be installed to $GOBIN or $GOPATH/bin.

Quick start

Create a profile in interactive mode:

git-profile add

Apply a profile in the current Git repository:

git-profile use

Usage

add

Add a key to a profile or update an existing one:

git-profile add work user.name "John Doe"
git-profile add work user.email work@example.com
git-profile add work user.signingkey AAAAAAAA

Run without arguments to start interactive mode:

git-profile add

Interactive mode asks for: - profile name - user.name - user.email - user.signingkey

For an existing profile, current values are prefilled. For a new profile, empty fields are skipped.

list

Show all available profiles:

git-profile list

del

Delete a profile or a specific key from a profile:

git-profile del
git-profile del work
git-profile del work user.email

When called without arguments, del opens an interactive profile selector and deletes the selected profile. Press Esc or Ctrl+C to cancel.

use

Apply a profile to the current Git repository:

git-profile use work

Under the hood, this writes local Git config values, for example:

git config --local user.name "John Doe"
git config --local user.email work@example.com
git config --local user.signingkey AAAAAAAA

Run without arguments to select a profile interactively:

git-profile use

use must be executed inside a Git repository.

unuse

Remove the applied profile entries from the current Git repository:

git-profile unuse work

Under the hood, this unsets the local Git config values, for example:

git config --local --unset user.name
git config --local --unset user.email
git config --local --unset user.signingkey

Run without arguments to remove the currently applied profile:

git-profile unuse

unuse must be executed inside a Git repository.

current

Show the currently selected profile for the current repository:

git-profile current

export

Export a profile as JSON:

git-profile export work
git-profile export work > work.json

Example output:

[
  { "key": "user.name", "value": "John Doe" },
  { "key": "user.email", "value": "work@example.com" },
  { "key": "user.signingkey", "value": "AAAAAAAA" }
]

import

Import a profile from JSON:

git-profile import work '[{"key":"user.name","value":"John Doe"},{"key":"user.email","value":"work@example.com"}]'

If you already have JSON in a file:

git-profile import work "$(cat work.json)"

Config file

By default, Git Profile stores profiles in:

~/.gitprofile

You can override it with:

git-profile --config /path/to/file add work user.email work@example.com

Shell Completion

Shell completion is available for git-profile.

Note: use git-profile ..., not git profile ..., when generating or using completion.

Bash

Requires bash-completion.

source <(git-profile completion bash)

To install permanently:

git-profile completion bash | sudo tee /etc/bash_completion.d/git-profile

On macOS:

git-profile completion bash > $(brew --prefix)/etc/bash_completion.d/git-profile

Zsh

mkdir -p ~/.zsh/completions
git-profile completion zsh > ~/.zsh/completions/_git-profile
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrc
source ~/.zshrc

Fish

git-profile completion fish | source
git-profile completion fish > ~/.config/fish/completions/git-profile.fish

License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

PrintErrln
called by 24
internal/ui/colors.go
Println
called by 18
internal/ui/colors.go
Execute
called by 16
cmd/root.go
multiline
called by 6
cmd/root.go
Lookup
called by 6
cmd/interfaces.go
IsAborted
called by 5
internal/ui/ui.go
StoreCalls
called by 5
cmd/mock.go
Save
called by 5
cmd/interfaces.go

Shape

Function 67
Method 50
Struct 7
Interface 2

Languages

Go100%

Modules by API surface

cmd/mock.go26 symbols
cmd/interfaces.go14 symbols
internal/config/config.go11 symbols
internal/git/git_test.go6 symbols
internal/git/git.go6 symbols
internal/ui/ui.go5 symbols
cmd/root.go5 symbols
cmd/add_test.go5 symbols
cmd/add.go5 symbols
cmd/use.go4 symbols
cmd/unuse_test.go4 symbols
cmd/unuse.go4 symbols

For agents

$ claude mcp add git-profile \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact