Skip to content

Installing Git

Installing Git on Linux Servers

Installing git on both Red Hat & Debian family:

				
						# yum install git
	# apt install git
	$ git --version
		  git version 2.30.2

				
			

Global username is because to identify yourself when making changes on repositories.

				
						# git config --global user.name “Hamed Khanmohammadi”
	# git config --global user.email “hamed@localhost”
	$ cat ~/.gitconfig
			[user]
			email = ubuntu@localhost
			name = Hamed Khanmohammadi
			signingKey = 2C527A35CADECF49

				
			

Git Basic Configurations

Local Configuration

Global Configuration

System-Level Configuration

				
					# cat .gitconfig

				
			
				
					# git config --list

				
			
				
					# cat /etc/gitconfig

				
			

Local configs are only available for the current project and stored in .git/config in the project’s directory.

Global configs are available for all projects for the current user and stored in ~/.gitconfig.

System config applies to the entire system for all the users/projects and stored in /etc/gitconfig.

Git Basic Configurations

				
					# git config --system system.name “Git Repo Srv-1”
# git config --system user.name “Arash Foroughi”
# git config --global system.name “My Repo Srv-1”
# git config --global core.editor vim
# git config --global core.pager ‘less’
# git config --list
# cat ~/.gitconfig
[user]
        name = Root User
        email = root@localhost
[system]
        name = My Git Repo Server1
[core]
        editor = vim
        pager = more

				
			

Leave a Reply

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