How to do it...

You can use git config to query your local and global Git configuration. In this section, we will show a couple of examples.

  1. To view all the effective configurations for the current Git repository, run the following command:
$ git config --list
user.name=John Doe
user.email=john.doe@example.com
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://git.eclipse.org/r/jgit/jgit
    remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    branch.master.remote=origin
    branch.master.merge=refs/heads/master

The previous output will, of course, reflect the user running the command. Instead of John Doe as the name and the email, the output should reflect your settings.

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.