Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check my github settings or who I'm signed in as on my current project through the terminal?

Tags:

git

github

My friend set up my github for me and cloned a project onto my desktop. I want to see what is my profile name on the Github account he gave me. Is there a command to do that?

like image 982
akantoword Avatar asked May 23 '16 18:05

akantoword


3 Answers

You can see the current configurations, including username, with git config -l.

You'll want to look for user.name, user.email, and github.user.

You can unset configurations using --unset, like git config user.name --unset.

You can also reset configurations using git config user.name "Your Name".

like image 181
Briana Swift Avatar answered Nov 17 '22 05:11

Briana Swift


To see which user is accessing github via terminal you could try SSH

ssh -T [email protected]

You get the following response

Hi Keshavdulal! You've successfully authenticated, but GitHub does not provide shell access.

I have multiple ssh keys setup for different projects and it helps to know the current user.

like image 21
KeshavDulal Avatar answered Nov 17 '22 06:11

KeshavDulal


git config -l | grep user.name

This will only output username in the terminal. Similarly, for email type:

git config -l | grep user.email

Note: This will only work on mac. For windows, refer to the comments.

like image 14
Gaurav Avatar answered Nov 17 '22 06:11

Gaurav