Professional Documents
Culture Documents
Devops Assignment 1
Devops Assignment 1
Devops Assignment 1
Name : Selvabharathi S
ID NO : 2022mt93556
Course Code : SEZG514
Course Name: Introduction to DevOps
==================================================
============================
Step 3) Move Code from One directory to Another Directory
==================================================
============================
You can see I have moved “test two.js” from “test two”
folder to “test one” folder, by just using cut, paste of
windows command.
As a result, my git kept monitoring behind, and when I
do git status, it tells me one file is deleted from “test
two” folder and one new file got added to “test one”
folder.
On moving this again become to “untracked” status, so
we need to add it to git so that this new file can be
tracked.
Using command “git add test one/test two.js (few
people may face git command err, if you have space
between your folder name)
==================================================
============================
Step 4) Update one source code file and display the
difference
==================================================
============================
So far our java script file doesn’t have any code to see
the difference, so lets add some code first and move
that code to stage status, so that on adding new code,
we can see the difference.
We got some code in “test one.js” lets modify this if
condition and see the diff, there are 2 ways to see diff one is
the IDE u are using, the another is via, traditional git
command, we will explore both.
I have used “git diff” command to see the diff in
traditional way.
Now lets see how IDE helps in seeing the diff.
IDE usually very help full, in visualization these kind of
diff, in production we have lot of diff to be checked, so
cmd like wont he helpful at that moment.
==================================================
=============================
Step 5) Create a Branch
==================================================
=============================
Use “git checkout –b branchName” command to create
a new branch from the current branch. There may be
other command too for creating a branch, and lot of diff
way to create it from IDE too. You can use whatever is
apt to your connivance.
We care currently in master branch, so on executing this
command, a new branch will be created from master.
Its advised to get the latest code on the branch from
which you are going to create another branch.
==============================================
===============================
Step 6) Add some raw code to the branch
==============================================
===============================
In new branch, I have modified one file, and created two
new files. Lets stage all of them and publish the new
branch. Have to do same process, “git add .” “git commit
commitMessage”. “git push origin –u side-work”
==============================================
===============================
Step 7) Merge the Branch with Main line
==============================================
===============================
It’s a public repo only, you can visit using this URL:
Selvabharathi-wilp-bits-pilani/bits-wilp-devops (github.com)
==================================================
==========================
And at the end provide the Summary of advantages of
moving from Centralized Source Code to Distributed Version
Control.
==================================================
=========================
1. Maintain multiple copies of repository which will avoid single point of failure in case of centralized
version control software -- Reliable backup copies
6. One of the biggest advantages of Git is its branching capabilities. Git branches are cheap and easy
to merge.