Volume XXII, number 280Wednesday, October 7, 2026Latest message 1 hour ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

[Feature Proposal] Add a built-in 'git whoami' command

3 messages between Mar 31, 2026 and Mar 31, 2026, from Giorgos Gasparis, Junio C Hamano, Kristoffer Haugsbakk.

Plain Markdown or JSON for tools and agents.

Giorgos GasparisMar 31, 2026, 14:57 UTC on lore
Hello Git team,

I would like to propose adding a native git whoami command to Git to easily check the currently active identity.

Currently, users have to run two separate commands (git config user.name and git config user.email) to check this. This is a frequent friction point for developers balancing work and personal repositories who want to double-check their active profile before committing.

To solve this locally, I currently use the following alias in my .gitconfig:

[alias] whoami = !echo "πŸ‘€ $(git config user.name) | πŸ“§ $(git config user.email)"

Having a built-in command that provides this kind of unified, single-line output natively (even as standard plain text without emojis) would be a great quality-of-life improvement for the wider community so they don't have to build custom aliases.

Thank you for your time and for maintaining Git, Georgios Gasparis
Junio C HamanoMar 31, 2026, 16:26 UTC in reply to Giorgos Gasparis on lore

Re: [Feature Proposal] Add a built-in 'git whoami' command

Giorgos Gasparis <gasp.giorgos@gmail.com> writes:
Show 7 quoted lines
> Hello Git team,
>
> I would like to propose adding a native git whoami command to Git to
> easily check the currently active identity.
>
> Currently, users have to run two separate commands (git config
> user.name and git config user.email) to check this.
"git var GIT_AUTHOR_IDENT"?
Kristoffer HaugsbakkMar 31, 2026, 16:43 UTC in reply to Giorgos Gasparis on lore

Re: [Feature Proposal] Add a built-in 'git whoami' command

On Tue, Mar 31, 2026, at 16:57, Giorgos Gasparis wrote:
Show 12 quoted lines
> I would like to propose adding a native git whoami command to Git to
> easily check the currently active identity.
>
> Currently, users have to run two separate commands (git config
> user.name and git config user.email) to check this. This is a frequent
> friction point for developers balancing work and personal repositories
> who want to double-check their active profile before committing.
>
> To solve this locally, I currently use the following alias in my .gitconfig:
>
> [alias] whoami = !echo "πŸ‘€ $(git config user.name) | πŸ“§ $(git config
> user.email)"
Strange. I was looking at an example from git-interpret-trailers(1) today.
    $ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
And β€œgit-whoami(1)?” jumped in to my mind.
You can kind of get that with [which Junio mentioned after I wrote this draft]
    git var GIT_AUTHOR_IDENT | sed -e 's/> .*/>/'
Too bad with the postprocessing needed for the timestamp.
> Having a built-in command that provides this kind of unified,
> single-line output natively (even as standard plain text without
> emojis) would be a great quality-of-life improvement for the wider
> community so they don't have to build custom aliases.
A problem (subjectively) is that there are already 147 git(1) commands.

Back to recent threads

[Feature Proposal] Add a built-in 'git whoami' command | The Git List