Exercise4 Devops
Exercise4 Devops
https://infyspringboard.onwingspan.com/web/en/app/toc/
lex_auth_01281262696086732810122_shared/overview
Modulename:ImplementationofCICDwithJavaandopensourcestack
ConfigurethewebapplicationandVersioncontrolusingGitusingGitcommandsandversion control
operations.
Answer:
GitInstallationonWindows
Step1:
DownloadthelatestversionofGitandchoosethe64/32bitversion.Afterthefileis
Step2:
ChecktheGitversion:
$git--version
Step3:
Foranyhelp,usethefollowing command:
$githelp config
This command will lead you to a browser of config commands. Basically, the help the
commandprovidesamanualfromthehelppageforthecommandjustfollowingit(here,it's config).
Anotherwaytousethesamecommandisasfollows:
$gitconfig--help
Step4:
Createalocaldirectoryusingthefollowing command:
$mkdirtest
$ cdtest
Step5:
Thenextstepistoinitializethedirectory:
$gitinit
Step6:
Gotothefolderwhere"test"iscreatedandcreateatextdocumentnamed"demo."Open "demo"
and put any content, like "Hello Simplilearn." Save and close the file.
Step7:
EntertheGitbashinterfaceandtypeinthefollowingcommandtocheckthestatus:
$git status
Step8:
Addthe"demo"tothecurrentdirectoryusingthefollowing command:
$ gitadd demo.txt
Step9:
Next,makeacommitusingthefollowingcommand:
$gitcommit-m"committing atextfile"
Step10:
Note:simplilearn-githubistheusernameontheGithubaccount. Step
11:
OpenyourGithubaccountandcreateanewrepositorywiththename"test_demo"andclickon "Create
repository." This is the remote repository. Next, copy the link of "test_demo."
Step12:
GobacktoGitbashandlinktheremoteandlocalrepositoryusingthefollowingcommand:
$gitremoteaddorigin<link>
Pushthelocalfileontotheremoterepositoryusingthefollowing command:
$gitpushorigin master
Step14:
MovebacktoGithubandclickon"test_demo"andcheckifthelocalfile"demo.txt"ispushed to this
repository.
AdditionalCustomizationOptions
1. Thisoptionenablesuserstoaddextraelementssuchassymboliclinksforcommandlines.
Nevertheless, one should always prefer default options for shortcuts or more.
2. TherearesomeexperimentaloptionsavailablesuchaspseudocontrolSupportorBuiltinfile system
monitor concerning your installed Git version.
HowtoLaunchGitin Windows?
Therearetwomethodstolaunchgitinwindows.Oneislaunchinggitusingabashscripting shell with
the help of the command line and another is launching git using a graphical user interface.
1. Tolaunchgitviabashscripting shell,
First,openthewindowandsearchforgitbashandopenit.
2. Tolaunchgitviagraphicaluserinterface(GUI),similarly,firstopenthewindowandsearch for git
GUI and click on the application icon and open it.
ConfigureGitHubCredentials
You can configure your local GitHub installation with credentials by using the following
commands.Also,don'tforgettoaddyourownGitHubcredentialsforusernameandemail address.
1. gitconfig–globaluser.n
ame "github_username"
2. gitconfig–globaluser.e
mail "email_address"
CloneaGitHub Repository
1. InitiallyyouneedtoclicktheoptionsrepositoryonGitHub.
2. Theninthetoprightcorner,clicktheoptioncloneordownloadwhereasmalldrop-down box will
appear having a URL for cloning over HTTPS.
3. ThenenterintoyourPowershellwindowsandwritecloneURLas: git
clone repository_url
4. On theother hand, you can clone a github repository with SSH URLs where first you need to
generateanSSHkeypaironyourwindowsworkstationaswellasneedtoassignapublickey to your
GitHub account.
ListRemoteRepositories
1. MakeacopyoftherepositoryfromGitHubforyourworkingdirectory.
2. Ensurethattheworkingdirectoryshouldhavetheprojectnameas
"cdgit_project"andreplacetheprojectnamefromthedownloadedrepository.
3. Iftheaboveoptiondoesn'twork,you can listthecontentusing "lscommand"forthecurrent
directory, especially to check your exact number of spellings.
4. Besides,youcanlisttheremoterepositoryinthesub-directoryas"gitremote-v".
Summary:StepsForGitInstallationonWindows10
1. Downloadandinstall Git
2. Gitbash interface
3. BasicGitcommands
4. Createalocalrepository
5. Connecttotheremoterepository
6. PushthefiletoGitHub
Step1.Downloadtheinstaller
GototheGitForWindowswebsiteandclickonthe[Download]buttontodownloadandsave the
installer. Once downloaded double-click on the .exe file to begin installation.
Step2.License Information
ToaccepttheLicenseAgreementclick[Next>]
Step3.SelectInstallationFolder
Irecommendselectingadirectorypathwithnospacesinthename,asintheillustrationbelow
Step4.SelectComponents
Selectthefollowingcomponentsandfileassociations,thenclick[Next>]
Step5.SelectStartMenu Folder
Step6.ChooseDefaultEditor
LetGitdecideandclick[Next>]
Step8.AdjustPATHEnvironment
Makesureyouselect“UseGitfromGitBash only”
Step9.SelectHTTPS transport
SpecifythelibrarytouseforsecureHTTPconnections.GoforOpenSSLunlessyouhavea reason to do
otherwise
Step10.ConfigureLineEndingConversions
Makesureyouselect“CheckoutWindows-style,commitUnix-stylelineendings”
Step11.SelectBehaviourofPullCommand
SelectDefault
Step12.SelectCredentialHeler p
Gowiththerecommendedchoice
Step13.ConfigureExtraOptions
Leaveuncheckedandclick[Next>]
Step14.ConfigureExperimentalOptions
Leaveuncheckedandclick[Next>]
Step15.ProgressBar
Installationbegins…
Step16.InstallationComplete
Clickon[Finish].Congratulations…jobdone!