Git – Environment Setup and Basic Configuration

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-environment-setup-basic-configuration/
PINTEREST
PINTEREST
INSTAGRAM

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 user.name and user.email . After setting user info we can check with config -l command.

LEARN MORE  Find Out Other Users Operations

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.

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  Git - Branching Operations

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.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-environment-setup-basic-configuration/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)