Time for action – configure Git in CLI mode

To configure Git using CLI you can use the following commands:

git config --global user.name "your full name"
git config --local user.name "your full name"
git config --global user.email "your email id"
git config --local user.email "your email id"
git config -l
Time for action – configure Git in CLI mode

What just happened?

By giving out our username and e-mail address both locally and globally we have provided ways for Git to identify and group the changes made to files present in any repository.

config is the operational keyword that needs to be used with git to set up the configuration of Git. To set a global value we add the --global parameter with the command, and to set a local value we add the --local parameter with the command.

As the name indicates, global configuration is nothing but a global value for all repositories created in the system by that system user, whereas local configuration is the exact opposite. As you would have guessed by now, the parameters user.name and user.email are used to record the user's name and e-mail address, respectively.

To get a list of configurations set till date you can use the last command, which had the –l parameter. It lists all the configuration variables for you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.24.134