Git Install and Create Bare Repository

Ticker

6/recent/ticker-posts

Git Install and Create Bare Repository

 Question: The Nautilus development team shared requirements with the DevOps team regarding new application development.—specifically, they want to set up a Git repository for that project. Create a Git repository on Storage server in Stratos DC as per details given below:

Install git package using yum on Storage server.

After that create a bare repository /opt/media.git (make sure to use exact name).

  Please Note :-  Perform the below commands based on your question  server,  user name & other details might differ . So please read task carefully before executing. All the Best 👍


Solution:  

1. At first login on storage server  & switch to root user

thor@jump_host /$ ssh natasha@ststor01

The authenticity of host 'ststor01 (172.16.238.15)' can't be established.

ECDSA key fingerprint is SHA256:IxwAD3ZVWxJeoVZGlhqWNAp/2Waue9JvaV7Hz6hyyfg.

ECDSA key fingerprint is MD5:87:7c:77:5f:04:db:fa:a3:35:82:e6:d9:d4:f0:1c:35.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'ststor01,172.16.238.15' (ECDSA) to the list of known hosts.

natasha@ststor01's password:

[natasha@ststor01 ~]$ sudo su -

 We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

     #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.

 [sudo] password for natasha:

[root@ststor01 ~]#

2. Install git 

[root@ststor01 ~]# yum install -y git

Loaded plugins: fastestmirror, ovl

Determining fastest mirrors

 * base: mirrors.vangus.co.il

 * extras: linux.darkpenguin.net

 * updates: linux.darkpenguin.net

base                                                      | 3.6 kB  00:00:00    

extras                                                    | 2.9 kB  00:00:00    

updates                                                   | 2.9 kB  00:00:00    

(1/4): base/7/x86_64/group_gz                             | 153 kB  00:00:00    

(2/4): extras/7/x86_64/primary_db                         | 242 kB  00:00:00    

(3/4): updates/7/x86_64/primary_db                        | 8.8 MB  00:00:00    

(4/4): base/7/x86_64/primary_db                           | 6.1 MB  00:00:00    

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 >= 5.008 for package: git-1.8.3.1-23.el7_8.x86_64

Installed:

  git.x86_64 0:1.8.3.1-23.el7_8                                                 

 Dependency Installed:

  groff-base.x86_64 0:1.22.2-8.el7                                              

  less.x86_64 0:458-9.el7                                                       

  libedit.x86_64 0:3.0-12.20121213cvs.el7

Complete!

[root@ststor01 ~]#                      

3. Verify Installed git version & path where git need to initiated

[root@ststor01 ~]# rpm -qa |grep git

git-1.8.3.1-23.el7_8.x86_64

[root@ststor01 ~]#

[root@ststor01 ~]# ll /opt

total 0

 [root@ststor01 ~]#

4. Make sure you init  bare  repo in given path 

[root@ststor01 ~]# cd /opt/

[root@ststor01 opt]# ll

total 0

[root@ststor01 opt]# git init  --bare media.git

Initialized empty Git repository in /opt/media.git/

[root@ststor01 opt]#

[root@ststor01 opt]# ll

total 4

drwxr-xr-x 3 root root 4096 Jun 15 07:18 media.git

[root@ststor01 opt]# git status

fatal: Not a git repository (or any of the parent directories): .git

[root@ststor01 opt]# 


5Click on Finish & Confirm to complete the task successful

Happy Learning!!!!

Apart from this if you need more clarity,  I have made a  tutorial video on this , 

please go through and share your comments. Like and share the knowledge




Post a Comment

2 Comments

  1. how do u get password

    ReplyDelete

  2. @nbtechsupport
    0 seconds ago
    For storage user natasha password is Bl@kW. Apart from that for any server check this page to get all passwords https://www.nbtechsupport.co.in/2022/08/kodekloud-servers-login-credentials.html

    ReplyDelete

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user