
Domains
Agile Management
Master Agile methodologies for efficient and timely project delivery.
View All Agile Management Coursesicon-refresh-cwCertifications
Scrum Alliance
16 Hours
Best Seller
Certified ScrumMaster (CSM) CertificationScrum Alliance
16 Hours
Best Seller
Certified Scrum Product Owner (CSPO) CertificationScaled Agile
16 Hours
Trending
Leading SAFe 6.0 CertificationScrum.org
16 Hours
Professional Scrum Master (PSM) CertificationScaled Agile
16 Hours
SAFe 6.0 Scrum Master (SSM) CertificationAdvanced Certifications
Scaled Agile, Inc.
32 Hours
Recommended
Implementing SAFe 6.0 (SPC) CertificationScaled Agile, Inc.
24 Hours
SAFe 6.0 Release Train Engineer (RTE) CertificationScaled Agile, Inc.
16 Hours
Trending
SAFe® 6.0 Product Owner/Product Manager (POPM)IC Agile
24 Hours
ICP Agile Certified Coaching (ICP-ACC)Scrum.org
16 Hours
Professional Scrum Product Owner I (PSPO I) TrainingMasters
32 Hours
Trending
Agile Management Master's Program32 Hours
Agile Excellence Master's ProgramOn-Demand Courses
Agile and ScrumRoles
Scrum MasterTech Courses and Bootcamps
Full Stack Developer BootcampAccreditation Bodies
Scrum AllianceTop Resources
Scrum TutorialProject Management
Gain expert skills to lead projects to success and timely completion.
View All Project Management Coursesicon-standCertifications
PMI
36 Hours
Best Seller
Project Management Professional (PMP) CertificationAxelos
32 Hours
PRINCE2 Foundation & Practitioner CertificationAxelos
16 Hours
PRINCE2 Foundation CertificationAxelos
16 Hours
PRINCE2 Practitioner CertificationSkills
Change ManagementMasters
Job Oriented
45 Hours
Trending
Project Management Master's ProgramUniversity Programs
45 Hours
Trending
Project Management Master's ProgramOn-Demand Courses
PRINCE2 Practitioner CourseRoles
Project ManagerAccreditation Bodies
PMITop Resources
Theories of MotivationCloud Computing
Learn to harness the cloud to deliver computing resources efficiently.
View All Cloud Computing Coursesicon-cloud-snowingCertifications
AWS
32 Hours
Best Seller
AWS Certified Solutions Architect - AssociateAWS
32 Hours
AWS Cloud Practitioner CertificationAWS
24 Hours
AWS DevOps CertificationMicrosoft
16 Hours
Azure Fundamentals CertificationMicrosoft
24 Hours
Best Seller
Azure Administrator CertificationMicrosoft
45 Hours
Recommended
Azure Data Engineer CertificationMicrosoft
32 Hours
Azure Solution Architect CertificationMicrosoft
40 Hours
Azure DevOps CertificationAWS
24 Hours
Systems Operations on AWS Certification TrainingAWS
24 Hours
Developing on AWSMasters
Job Oriented
48 Hours
New
AWS Cloud Architect Masters ProgramBootcamps
Career Kickstarter
100 Hours
Trending
Cloud Engineer BootcampRoles
Cloud EngineerOn-Demand Courses
AWS Certified Developer Associate - Complete GuideAuthorized Partners of
AWSTop Resources
Scrum TutorialIT Service Management
Understand how to plan, design, and optimize IT services efficiently.
View All DevOps Coursesicon-git-commitCertifications
Axelos
16 Hours
Best Seller
ITIL 4 Foundation CertificationAxelos
16 Hours
ITIL Practitioner CertificationPeopleCert
16 Hours
ISO 14001 Foundation CertificationPeopleCert
16 Hours
ISO 20000 CertificationPeopleCert
24 Hours
ISO 27000 Foundation CertificationAxelos
24 Hours
ITIL 4 Specialist: Create, Deliver and Support TrainingAxelos
24 Hours
ITIL 4 Specialist: Drive Stakeholder Value TrainingAxelos
16 Hours
ITIL 4 Strategist Direct, Plan and Improve TrainingOn-Demand Courses
ITIL 4 Specialist: Create, Deliver and Support ExamTop Resources
ITIL Practice TestData Science
Unlock valuable insights from data with advanced analytics.
View All Data Science Coursesicon-dataBootcamps
Job Oriented
6 Months
Trending
Data Science BootcampJob Oriented
289 Hours
Data Engineer BootcampJob Oriented
6 Months
Data Analyst BootcampJob Oriented
288 Hours
New
AI Engineer BootcampSkills
Data Science with PythonRoles
Data ScientistOn-Demand Courses
Data Analysis Using ExcelTop Resources
Machine Learning TutorialDevOps
Automate and streamline the delivery of products and services.
View All DevOps Coursesicon-terminal-squareCertifications
DevOps Institute
16 Hours
Best Seller
DevOps Foundation CertificationCNCF
32 Hours
New
Certified Kubernetes AdministratorDevops Institute
16 Hours
Devops LeaderSkills
KubernetesRoles
DevOps EngineerOn-Demand Courses
CI/CD with Jenkins XGlobal Accreditations
DevOps InstituteTop Resources
Top DevOps ProjectsBI And Visualization
Understand how to transform data into actionable, measurable insights.
View All BI And Visualization Coursesicon-microscopeBI and Visualization Tools
Certification
24 Hours
Recommended
Tableau CertificationCertification
24 Hours
Data Visualization with Tableau CertificationMicrosoft
24 Hours
Best Seller
Microsoft Power BI CertificationTIBCO
36 Hours
TIBCO Spotfire TrainingCertification
30 Hours
Data Visualization with QlikView CertificationCertification
16 Hours
Sisense BI CertificationOn-Demand Courses
Data Visualization Using Tableau TrainingTop Resources
Python Data Viz LibsCyber Security
Understand how to protect data and systems from threats or disasters.
View All Cyber Security Coursesicon-refresh-cwCertifications
CompTIA
40 Hours
Best Seller
CompTIA Security+EC-Council
40 Hours
Certified Ethical Hacker (CEH v12) CertificationISACA
22 Hours
Certified Information Systems Auditor (CISA) CertificationISACA
40 Hours
Certified Information Security Manager (CISM) Certification(ISC)²
40 Hours
Certified Information Systems Security Professional (CISSP)(ISC)²
40 Hours
Certified Cloud Security Professional (CCSP) Certification16 Hours
Certified Information Privacy Professional - Europe (CIPP-E) CertificationISACA
16 Hours
COBIT5 Foundation16 Hours
Payment Card Industry Security Standards (PCI-DSS) CertificationOn-Demand Courses
CISSPTop Resources
Laptops for IT SecurityWeb Development
Learn to create user-friendly, fast, and dynamic web applications.
View All Web Development Coursesicon-codeBootcamps
Career Kickstarter
6 Months
Best Seller
Full-Stack Developer BootcampJob Oriented
3 Months
Best Seller
UI/UX Design BootcampEnterprise Recommended
6 Months
Java Full Stack Developer BootcampCareer Kickstarter
490+ Hours
Front-End Development BootcampCareer Accelerator
4 Months
Backend Development Bootcamp (Node JS)Skills
ReactOn-Demand Courses
Angular TrainingTop Resources
Top HTML ProjectsBlockchain
Understand how transactions and databases work in blockchain technology.
View All Blockchain Coursesicon-stop-squareBlockchain Certifications
40 Hours
Blockchain Professional Certification32 Hours
Blockchain Solutions Architect Certification32 Hours
Blockchain Security Engineer Certification24 Hours
Blockchain Quality Engineer Certification5+ Hours
Blockchain 101 CertificationOn-Demand Courses
NFT Essentials 101: A Beginner's GuideTop Resources
Blockchain Interview QsProgramming
Learn to code efficiently and design software that solves problems.
View All Programming Coursesicon-codeSkills
Python CertificationInterview Prep
Career Accelerator
3 Months
Software Engineer Interview PrepOn-Demand Courses
Data Structures and Algorithms with JavaScriptTop Resources
Python TutorialThis command gives a commit object a human readable name based on an available reference.
The command finds the most recent tag that is reachable from a commit. If the tag points to the commit, then only the tag is shown; otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object and the abbreviated object name of the most recent commit
Clone and get the working directory for the project: myProj

cd /Users/Divya1/Documents/GIT/gitRepos/myProj
git clone http://github.com/greets/myProj.git
Tags: are the save-points or stable commit points in the commit history of your source code.
In other words:
Tags are a friendly name to commits SHA-1
git tag –list
newFeature_add
t_featureB
v0.1
v1.0
v1.8
git tag -a release_r1.5 -m 'Tag the release version 1.5'

git tag --list
newFeature_add
release_r1.5
t_featureB
v0.1
v1.0
v1.8
- To checkout the project snapshot of a commit that is tagged

git checkout v1.8
Note: checking out 'v1.8'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 018d46a changes in the code
NOTE: It is similar to working on an old commit from the project history, you could edit the project files and create a new branch out of here with your changed commit objects over it.
Now these changes in the history of the project can be shared with the peers by merging in to the main branch (‘master’ in this case).
- To create a tag from an old commit ID
Let’s create another tag from tag: v1.8; so that both point to the same object id.

#Find out tag: v18 points to which commit object
git show v1.8 --no-patch
tag v1.8
Tagger: divya <divya_bhushan@hotmail.com>
Date: Wed Aug 15 17:31:21 2018 +0530
tag: 018d46a - changes in the code
commit 018d46aaf4177a0964e78e80c8e711771afff7c2 (tag: v1.8, tag: show, origin/branch_v1.8)
Author: divya <divya_bhushan@hotmail.com>
Date: Thu Mar 5 19:46:12 2015 +0530
changes in the code
V1.8 points to 018d46a commit object

#List all the tags pointing to the same commit object id: 018d46a
Divya1@Divya:myProj [master] $git tag --points-at=018d46a
v1.8

#Create v1.3 from v1.8
Divya1@Divya:myProj [master] $git tag -a v1.3 018d46 -m '018d46: tagging'

#List all the tags pointing to the same commit object id: 018d46a
git tag --points-at=018d46a
v1.8
v1.3
NOTE: Now tag: v1.3 has been created; that also points to the same object id as tag: v1.8
Get the latest tag reachable from the latest commit object:
Git describe latest tag:

Divya1@Divya:myProj [master] $git describe
t_featureB-13-g9ecf5bd
Tag: t_featureB has 12 commits over it, fb5d4ee is the latest commit.
“g” stands for git (SCM), others like: CVS, Perforce, ClearCase etc…
To apply a tag into your current branch run the ‘git merge’ command giving the tag name as the commit id.
Example:
[dev] $ git merge v1.3
git grep command print lines matching a pattern
Project: /Users/Divya1/Documents/GIT/gitRepos/myProj
- Find all files whose content contains the string “bug”

myProj [master]$git grep -i "bug"
code/welcome.sh: echo "Bug fixed."
hotfix/hotfix.html:Fixing the bug: 101
- Count the number of times the pattern occurred in each file

--show the count of pattern “fix” that occurred in each file.
git grep -ic "fix"
code/editInfo.info:1
code/welcome.sh:4
hotfix/hotfix.html:2
iss54/iss54.log:1
temp/temp.tmp:1
- Print the line number at which the search string occurs

myProj [master] $git grep -in "fix"
code/editInfo.info:5:hotfix
code/welcome.sh:20:echo "HOTFIX ADDED !!!"
code/welcome.sh:21:echo "quickfix branch"
code/welcome.sh:22:quickfix_func(){
code/welcome.sh:23: echo "Bug fixed."
hotfix/hotfix.html:3:<title>Hotfix page</title>
hotfix/hotfix.html:6:Fixing the bug: 101
iss54/iss54.log:3:fix.
temp/temp.tmp:10:hotfix branch
i = case-insensitive
n = show line numbers
c = count the occurrences
- List all the filenames whose content contains the pattern

--List all the filenames that contains the string “feature”
myProj [master] $git grep -il "feature"
featureB/README.txt
temp/temp.tmp
This tool tells you which commit was responsible for that bug, when, why and by whom was it introduced.
project: myProj
git checkout master
Git blame example:
--blame all the lines

git blame code/welcome.sh
- Print only certain line numbers in the debug mode

[master] $git blame -L 11,20 code/welcome.sh
9ecf5bd7 (administrator 2018-09-07 13:40:18 +0530 11) adminTasks
9ecf5bd7 (administrator 2018-09-07 13:40:18 +0530 12) echo "TimeStamp:"`date "+%Y_%m_%d_%H:%M:%S"`
e69eee03 (greets 2014-11-14 22:50:35 +0530 13) #today
^86792c6 (greets 2014-11-14 22:37:07 +0530 14) echo "Hello $LOGNAME !"
36b2f386 (divya 2015-03-05 12:05:37 +0530 15) echo "Changes committed"
018d46aa (divya 2015-03-05 19:46:12 +0530 16) echo "changes staged"
018d46aa (divya 2015-03-05 19:46:12 +0530 17) echo "changes only in working dir"
5bdd026e (divya 2015-03-05 19:46:12 +0530 18) echo "changes staged"
5bdd026e (divya 2015-03-05 19:46:12 +0530 19) echo "changes only in working dir"
904ce2b9 (greets 2017-12-15 19:55:35 +0530 20) echo "HOTFIX ADDED !!!"
field 1: SHA-1
field 2: author name and the authored date
field 3: content of the file
NOTE:
Lines beginning with ^ are the lines in the file which were introduced in the repositories initial commit and have remained unchanged.
You could use “-w” flag to ignore the white space changes.
Useful when you don’t know what code is breaking, you are not sure of when was the last time the code was working.
The bisect command does a binary search through your commit history to help you identify as quickly as possible which commit introduced an issue.
Lab Exercises
1) Identify the cause of a bug.
Project: ~/Onedrive/gitRepos/bisectTest
Run the ./code/runTest.sh script, that fails with the error message(un-expected):

bisectTest [master] $./code/runTest.sh
[OK]: /Users/Divya1/OneDrive/gitRepos/bisectTest/log/err.out file exists
./code/runTest.sh: line 21: no_function: command not found
Process failed !!! returning to the main program...
2) Debug the code
--start the bisect mode
bisectTest [master] $git bisect start

* 035f294 2019-01-26 | Add date in the commonLibrary.sh script (HEAD -> master) [divya bhushan]
* c220d66 2019-01-26 | Add data/data.log file [divya bhushan]
* eee1437 2019-01-26 | Introduce a bug in the script [divya bhushan]
* 6a9fb7a 2019-01-26 | Add the .gitignore rules file [divya bhushan]
* 654e9b2 2019-01-26 | testing the script fine. ready for deployment [divya bhushan]
* bba6094 2018-09-27 | Add exit_status lib function [divya]
* b4161e6 2018-09-27 | Adding log directory and err.out file [divya]
* e4d3ed3 2018-09-27 | Adding library functions [divya]
* ff019ad 2018-09-27 | Adding the initial project structure [divya]
Commit id: 654e9b2 was the last commit where the deployment happened.
BONUS: You could also checkout to the commit id: 654e9b2 and test the code/runTest.sh script ran fine.

--Pass on the last known good commit
bisectTest [master] $git bisect good 654e9b2
--Also pass the latest bad commit id
bisectTest [master] $git bisect bad 035f294
Bisecting: 1 revision left to test after this (roughly 1 step)
[eee1437b9ce95b6ac3690cd0f541786b09f468a0] Introducing a bug in the script
bisectTest [(no branch, bisect started on master)]
NOTE:
HEAD pointer of current ‘master’ branch points jumps back to the eee1437 commit id in the middle of the range of good and bad commit history.
Bisect command checks out ‘eee1437’.
Compile and test the checked-out version in this snapshot, if the code here works fine type ‘git bisect good’ if not type ‘git bisect bad’
Keep repeating the process until you find the commit snapshot with the good code.
After a bisect session, to clean up the bisection state and return to the original HEAD, issue the following command:

bisectTest [(no branch, bisect started on master)] $./code/runTest.sh
[OK]: /Users/Divya1/OneDrive/gitRepos/bisectTest/log/err.out file exists
./code/runTest.sh: line 21: no_function: command not found
Process failed !!! returning to the main program...
bisectTest [(no branch, bisect started on master)] $git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[6a9fb7a01f0cf4afa5c739024b33d3083e31fff9] Add the .gitignore rules file
bisectTest [(no branch, bisect started on master)] $./code/runTest.sh
[OK]: /Users/Divya1/OneDrive/gitRepos/bisectTest/log/err.out file exists

bisectTest [(no branch, bisect started on master)] $git bisect good
eee1437b9ce95b6ac3690cd0f541786b09f468a0 is the first bad commit
commit eee1437b9ce95b6ac3690cd0f541786b09f468a0
Author: divya bhushan <divya_bhushan@hotmail.com>
Date: Sat Jan 26 10:34:26 2019 +0100
Introduce a bug in the script
:040000 040000 319a812a5c080f70a74fb8b3de93b1fcaced875f 611b3b9eac89e8228c6a1567a4142d002185b0a8 M code

bisectTest [(no branch, bisect started on master)] $git bisect reset
Previous HEAD position was 6a9fb7a Add the .gitignore rules file
Switched to branch 'master'
‘git bisect’ command checked the good version of the code in the previous snapshots between the good and bad commits. It checked-out the earlier snapshot and allowed you to compile and run the code.
eee1437 is the first bad commit: Introduce a bug in the script
Logically 6a9fb7a becomes the last known good project snapshot where the code was fine.
To fix the broken code get the good code from this old commit snapshot and test it:

bisectTest [master] $git checkout 6a9fb7a code/runTest.sh
Divya1@Divya:bisectTest [master] $./code/runTest.sh
[OK]: /Users/Divya1/OneDrive/gitRepos/bisectTest/log/err.out file exists
Run a ‘git diff’ command to see the code of broken lines removed:

bisectTest [master] $git diff --staged code/runTest.sh
diff --git a/code/runTest.sh b/code/runTest.sh
index 03a1c5d..a023b60 100755
--- a/code/runTest.sh
+++ b/code/runTest.sh
@@ -17,10 +17,6 @@ else
echo "\n[NOK]: $FILENAME file does not exists\n"
fi
-#introduce a bug: Calling a function that does not exist in the library file.
-no_function
-exit_status
-
exit 0
}
‘git status’ shows the modified file.

bisectTest [master] $git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: code/runTest.sh
Summary: Fixed the broken code.