Git – Environment Setup and Basic Configuration – POFTUT

Git – Environment Setup and Basic Configuration

Installing git is easy with operating system provided packages like apt or dnf. We can track here Fedora way with dnf but it is very similar for other operating systems like CentOS, Debian, Ubuntu etc.

First-Time Configuration

After installing git making some configuration will make usage of the git more easy. System wide configuration is held in /etc/gitconfig .

But more practical configuration can be done in the users home directory. .gitconfig file stores user wide configuration and this configuration is used by all projects if project wide configuration is not exists.

And project specific configuration is held in the .git/config file.

User Configuration

As there will be a lot of commit in big repositories user tracking is important. We can set our name and email for the project but setting them globally will make it more practical because we are busy developers and programming a lot of different projects 😉

We set our user name with config command for the –global and providing username and email values with and . After setting user info we can check with config -l command.

LEARN MORE  How To Add A User To A Group?

Checking Configuration

Existing configuration can be listed with config command like below.

  • --list is used to list configuration

Getting Help

Before starting to work with git knowing how to get help from git is better.

echo '

As we see that git has a lot of commands for different purposes but we will use only some of them in this tutorial. If we need to remember some commands we can use this help.

LEARN MORE  Access.conf Security Configuration For Linux and Unix

Initialize git Repository

Repository is the location where directory and related files reside. If we list files in the initialized path we can see that a hidden directory named .git is created. It is the core where magic happens.

Leave a Reply

Your email address will not be published. Required fields are marked *