Git Initial configuration and proxy settings

First Time Git Setup
To globally configure your name and mail id in git, use these below commands
git config --global user.name "your name" 

git config --global user.email “yourmailid@domain.in”
You can verify the user name and user mail by typing
git config user.name

git config user.email
If you want to check your settings use the command
git config --list

Set the Proxy
To set the proxy in git by typing
git config --global http.proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>

git config --global https.proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>
 or you can directly edit your ~/.gitconfig file
[http]
        proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>
[https]
        https.proxy http://<user-name>:<password>@<IP-or-DNS-name>:<port- number>

Unset the Proxy
To reset the proxy and work without proxy, use the --unset flag to remove configuration being specific about the property. Consider using any of the following:
git config --global --unset http.proxy

git config --global --unset https.proxy
Check the current Proxy
git config --global --get http.proxy
If you're still having trouble cloning or fetching and are now getting an unable to access https://****.com/*****': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to *****.com:443  then you may decide to switch off SSL verification for the single operation by using the http.sslVerify=false 
git config http.sslVerify false
References:
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
https://gist.github.com/evantoli/f8c23a37eb3558ab8765
https://stackoverflow.com/questions/783811/getting-git-to-work-with-a-proxy-server

Comments