Skip to main content

Command Palette

Search for a command to run...

Deep Dive in Git & GitHub for DevOps Engineers part 2 #Day 9

Published
3 min readView as Markdown
Deep Dive in Git & GitHub for DevOps Engineers part 2 #Day 9
H

Harsh Rajotya is a technical blogger and a cloud DevOps engineer with a BE in Electronics and Computers from M.B.M. Engineering College, Jodhpur. He holds multiple certifications in AWS, Python, and RHCSA8, and is proficient in various cloud computing, infrastructure provisioning, containerization, CI/CD, and configuration management technologies and tools.

As a DevOps engineer at DevOpsFarm Inc, he deploys and manages end-to-end applications using Jenkins, Git, Terraform, Docker, and Kubernetes on AWS. He has experience in working with several AWS services, such as EC2, EBS, S3, VPC, autoscaling, and load balancing, and implements security policies using IAM, inline policies, and bucket policies. He also handles scheduled Cron jobs for snapshots and backups and is familiar with Ansible and Chef. He is passionate about learning new technologies and sharing his knowledge through technical blogging on Medium, where he has worked on projects involving deploying full-stack, Node.js, and MongoDB applications.

Task1:

Set your user name and email address, which will be associated with your commits.

First, install git in your instance

sudo apt-get install git init

then you can check that git is installed or not with the help of this command

git  --version

\> Now create a username and email address

git config --global user.name "Enteryourname"
git config --global user.email "Enteryouremail"

To check username and password use this command

git config --list

Task2:

Create a repository named “Devops” on GitHub.

now go into your git hub account

Go to the dashboard and click on the “New” button to create the repository.

it will look like this

Connect your local repository to the repository on GitHub.

first of all, go into the GitHub dashboard then open your repo.

then click on code this is will in the right-side corner it will look like this

Then copy your ssh- key, then open your terminal and type this command to connect your local repository to the GitHub repository

sudo git clone <ssh-key-url>

Create a new file in Devops/Git/Day-02.txt & add some content to it

Now go to the DevOps folder/directory

cd DevOps/

Now create another folder/directory and create a text file and some content inside the file.

mkdir Git
cd Git/
vi Day-02.txt
welcome to DevOps
esc
:wq

to check the file status use the command “git status” With the help of this command you can file is committed or not

git status

git add .

git status

After the check status of the file the commit your file this commit will show on your GitHub account there will show also the user name who commit to that

git commit -m "this is first commit"

git status

you can check the file comment with the help of “git log “ where you will see your commit id 40alphanumeric type git log and paste your commit your will comment

git log

now push your code file on your remote account use of this command ‘’git push origin main”

git push origin main

To check that your file is now present on your “GitHub account go to the account

and click on your repo. you will your repo name like “DevOps” Click on the you will another folder “Git”.

After clicking on “Git” you will see a file name like “Day-02.txt” Click on that now there will show you the file and the file comment on the top.

More from this blog

90 Days of DevOps

30 posts