In the last post, we have seen how to install Git
into Ubuntu
machine and some configuration of it. In this post we will see more about config.
How to get username and email
We have set the user name and email in the last post. How can we get the username and email to verify it?
This will return the username. Username can be picked up from local config if you are in repository otherwise it will pick from global configuration.
This will return the email of user. Email can be picked up from local config if you are in repository otherwise it will pick from global configuration.
You can fetch user name and email from specific configuration by passing the options. You can do like below.
To get from global configuration file. Need to pass --global
.
To get from local configuration file. Need to pass --local
. To run the below command, you must
be in local repository.
List Git Settings
You can print the Git setting using the below command.
You are in local repository and run this command. It will list all the local, global and system config. But if you are not in git directory then it will list system and global config of git.
List Git Settings by config
To print the system config. pass the --system
option.
To print the global user config. pass the --global
option.
To print the local user config. pass the --local
option. You must be in git repo.
No comments :
Post a Comment