top of page
Writer's pictureSiddhesh Kadam

Git Installation & Initial Setup

Git is a distributed version control system that is free and open source and is made to efficiently and quickly handle projects of all sizes. Types of version control systems:

1. Centralized Version Control System. 2. Distributed Version Control System. 1. Centralized Version Control System Centralized version control systems have a single repository that all users must commit to in order for their changes to be reflected in the repository.


A central repository serves as the primary server in a centralized version control system and stores all code versions. The central repository server's single point of failure in this system is its biggest drawback.


2. Distributed Version Control System. Multiple repositories are present in distributed version control systems. Every user has his or her own repository and working copy. Simply committing your changes does not authorize other's access to them. This is due to the fact that the commit will only reflect those changes in your local repository, and you must push them to make them visible on the central repository. Similarly, when you update, you do not get other's changes unless you first pull them into your repository.


Install Git on Linux (Centos/RHEL) :

1. Install Git using yum

[root@siddhesh ~]# yum install git
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-23.el7_8 for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-23.el7_8.x86_64
--> Running transaction check
---> Package perl-Git.noarch 0:1.8.3.1-23.el7_8 will be installed
--> Finished Dependency Resolution
Output Truncated
Installed:
  git.x86_64 0:1.8.3.1-23.el7_8                                                                                                  
Dependency Installed:
  perl-Git.noarch 0:1.8.3.1-23.el7_8                                                                                             
Complete!
[root@siddhesh ~]# 

2. Verify Git Version

[root@siddhesh ~]# git --version
git version 1.8.3.1
[root@siddhesh ~]# 

3. Configure the git commit username and email address

[root@siddhesh ~]# git config --global user.name "Siddhesh Kadam"
[root@siddhesh ~]# git config --global user.email "siddhesh@builddevops.com"
[root@siddhesh ~]# git config --list
user.name=Siddhesh Kadam
user.email=siddhesh@builddevops.com
[root@siddhesh ~]# cat .gitconfig 
[user]
	name = Siddhesh Kadam
	email = siddhesh@builddevops.com
[root@siddhesh ~]# 

.gitconfig is a file that stores all of git's configuration settings.


Kommentare

Mit 0 von 5 Sternen bewertet.
Noch keine Ratings

Rating hinzufügen
bottom of page