Cloude Devops Logo Free Clss Will start on Devops from July 15th
Cloud DevOps
Cloud DevOps

Git Environment Setup

First-Time Git Setup

Now that you have Git on your system, you'll want to do a few things to customize your Git environment. You should have to do these things only once on any given computer; they'll stick around between upgrades. You can also change them at any time by running through the commands again.

Git comes with a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates. These variables can be stored in three different places:

1. /etc/gitconfig file: Contains values applied to every user on the system and all their repositories. If you pass the option --system to git config, it reads and writes from this file specifically. Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.

2. ~/.gitconfig or ~/.config/git/config file: Values specific personally to you, the user. You can make Git read and write to this file specifically by passing the --global option, and this affects all of the repositories you work with on your system.

3. config file in the Git directory (that is, .git/config) of whatever repository you're currently using: Specific to that single repository. You can force Git to read from and write to this file with the --local option, but that is in fact the default. Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly.

Each level overrides values in the previous level, so values in .git/config trump those in /etc/gitconfig.

On Windows systems, Git looks for the .gitconfig file in the $HOME directory (C:\Users\$USER for most people). It also still looks for /etc/gitconfig, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer. If you are using version 2.x or later of Git for Windows, there is also a system-level config file at C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, and in C:\ProgramData\Git\config on Windows Vista and newer. This config file can only be changed by git config -f as an admin.

Launch Git Bash Shell

To launch Git Bash open the Windows Start menu, type git bash and press Enter (or click the application icon).

git configuration

git configuration

You can view all of your settings and where they are coming from using:

$ git config --list --show-origin

git configuration

Your Identity

Set up a username and email address

By setting up a username and email address in Git, any commits made will be recorded and you will be able to identify who the commits were created by. Run the commands below to set up your details:

git config --global "username"

git config --global "email address"

(You can choose your own username and email address) Below is just an example.

git config --global "clouddevops"

git configuration

git config --global "–"

git configuration

You can do one after one

See the bellow by given example

git configuration

The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it's immutably baked into the commits you start creating:

git config --global "clouddevops"

git configuration

git config --global "–"

git configuration

Now the initial setup is complete!

To check configuration details in local machine by given command

Cloud DevOps@DESKTOP-T1B0O13 MINGW64 /d/Git Projects
$ git config --list
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

Cloud DevOps@DESKTOP-T1B0O13 MINGW64 /d/Git Projects
git configuration

Again, you need to do this only once if you pass the --global option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or email address for specific projects, you can run the command without the --global option when you're in that project.

Many of the GUI tools will help you do this when you first run them.

The DevOps seminar will help you to learn DevOps from scracth to deep knowledge of various DevOps tools such as fallowing List.

Linux, Git, Jenkins, Maven, Apache Tomcat, Nexus, Ansible, Chef, MySQL Docker, Nagios,   Kubernetes.

Continue to Next