In Git and Subversion, how do I find out the current user at the terminal?

In Perforce, I can check who I am by running p4 info, here's the p4 doc. What's the equivalent for Git and Subversion at the terminal?


Presumably you are after the git user name that will be attached to any commits:

$ git config user.name
Wilbert Wilbert

$ git config --list
user.name=Wilbert Wilbert
[email protected]
color.status=auto
color.branch=auto
...

Keys might appear more than once because Git reads from several files (/etc/gitconfig and ~/.gitconfig, for example). Git uses the last value for each key it sees.


For name:

git config user.name

For email:

git config user.email

General:

git config --list
(this shows all available information)

There are several ways to find out stored logon credentials that will be used when you access remote Subversion server:

  • Run svn auth to view credentials and certificates cached in SVN credential store (%APPDATA%\Subversion\auth).
  • Run cmdkey to view the credentials stored in Windows Credential Manager.
  • If your SVN server is integrated with Active Directory and supports Integrated Windows Authentication, your Windows logon credentials are used for authentication, but they are not cached. You can run whoami to find out your user account name .

Note that there is no such thing as "current user" in SVN. In most cases, "current user" refers to user credentials cached on client that will be automatically presented to server on every access to the server.