
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 TutorialGit provides configuration file to set the initial parameters for the repository. There are 3 levels of configurations:
| Levels: | System | User | Project |
|---|---|---|---|
| Config file location: | /etc/gitconfig | ~/.gitconfig | Project/.git/config |
| List the configurations | git config --system --list | git config --global --list | git config --list |
| Edit the configuration: | git config --system --edit | git config --global --edit | git config --edit |
Below are the git basic commands used to set the configurations:
To set the levels of the configurations use the respective flags (--system, --global, none)
--Set the username for a logged in user, applicable to all the repositories
git config --global user.name "name"
--Set the password for the logged in user, applicable to all the repositories
git config --global user.password “yourpasswordString”
git config --global user.email "email"
--Set any editor of your preference as a system wide setting
git config --system core.editor "vim"
--Set the default tool as ‘vimdiff’ to be used for merging branches for only a project
cd ~/project
git config merge.tool "vimdiff"
--set a unique username for a project
git config user.name “user1”
--set a unique password for the user of this project
git config user.password “user1@123”
Add colors and show git branches in bash terminal edit the .bash_profile file:

vi ~/.bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
export PS1="\u@\h:\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $"
The best git workflow moves the source code from working directory to the Staging area to the local repository and then publishes it on the remote repository maintaining data integrity and tracking every bit of data change.
#Initialize your project to be a git project using the “init” command
The command create or initialize a new repository and places “.git” directory in the project root with metadata for the repo.

cd proj_workFlow
echo "Readme file." > README.file
git init .

Initialized empty Git repository in /Users/Divya1/myRepos/proj_workFlow/.git/



git status

On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.file
codes/
temp/
nothing added to commit but untracked files present (use "git add" to track)
Usage:
git add --all
git add .
git add -A
Step 1: Add one file alone

git add README
Step 2: Check the status

$git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.file
Untracked files:
(use "git add <file>..." to include in what will be committed)
codes/
temp/
Step 3: Add all the files

git add --all
OR
git add --A
OR
git add .
git status

On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.files
new file: codess/mycode.sh
new file: temp/file.tmp
Step 4: Modify the README file again and see the status
echo “version:1.0”>>README
git status

Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.file
new file: codes/mycode.sh
new file: temp/file.tmp
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.file
NOTE: Part of the file is staged and part of it with the new changes are not staged. If you commit this snapshot, the first edit of the README file will be saved in the repository; however the later edit still remains in the working directory alone.
Run git add again to stage the file.

git add .
git status

On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.file
new file: codes/mycode.sh
new file: temp/file.tmp
git commit -m “Initial commit”
[master (root-commit) bd5982e] Initial commit
3 files changed, 7 insertions(+)
create mode 100644 README.file
create mode 100644 codes/mycode.sh
create mode 100644 temp/file.tmp
A good commit message:
Commit c276e4ae3fec434209c133c03d82849bcac99e57 ( HEAD -> master )
Usage:
<script_name> <db_config> <db_name> <expectedTables_list_path>
Reported-by: whoever-reported-it
Signed-off-by: Your name <youremail@yourhost.com>


Diagram: Single commit repo data

Diagram: Git object data for multiple commits
Stage changes as multiple commits: breaking commits into logical units by committing separate commits.

echo "bugfix#1234">>codes/mycode.sh
echo "Project: git workflow">>README.file

$git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
modified: README.file
modified: codes/mycode.sh

git add code/code.sh
git commit -m "Add code for bug#1234"
git add README.file
git commit --m "Add project info"
Displays committed snapshots, you can filter or search for specific changes.
Displays committed snapshots, you can filter or search for specific changes.
Displays committed snapshots, you can filter or search for specific changes.
Project: proj_workFlow
commit 1e003594c6egit log
commit 1e003594c6e0f8850ec6d4fb9507f38e1ee80583 (HEAD -> master)
Author: divya bhushan <divya@developer.com>
Date: Fri Nov 16 15:20:43 2018 +0530
Add project info
commit d8f90e5e9949a43291f6206f522791c14bdda460
Author: divya bhushan <divya@developer.com>
Date: Fri Nov 16 15:20:21 2018 +0530
Add code for bug#1234
commit e6f82b5eb88863fb2d811ff5b2a1e18e76246bf4
Author: divya bhushan <divya@developer.com>
Date: Fri Nov 16 15:17:01 2018 +0530
Initial commit
Project: myProj
Log Example (1): git log
commit 3fbfa9a23bd7eac05226e08f40c0cb8138493619 (HEAD -> master)
Author: divya <divya@developer.com>
Date: Wed Aug 22 16:53:26 2018 +0530
Create the initial project structure
Log Example (2): Limiting the output to single line commit message
git log --oneline
3fbfa9a (HEAD -> master)
Create the initial project structure
Log Example (3): Limit the log output to n number of commits
git log -n2
or
git log -2
git log -5 --oneline
9ecf5bd (HEAD -> master, myProj/master) Adding admin tasks.
fb5d4ee Merge branch 'master' of https://github.com/greets/myProj
34a4e65 Update README to version 3.3
43d4441 (tag: new, origin/master, origin/HEAD) Update README to version 3.2
0f491ba (origin/issue) Merge branch 'master' of https://github.com/greets/myProj
1. Use alias “mylog” to display all logs in graphical one-liner format.
git config --global alias.mylog "log --graph --all --oneline"
2. Set the alias “hist” to print all the commits in pretty one-liner color coded format
git config --global alias.hist 'log --pretty=format:"%C(yellow)%h%Creset %ad | %C(green)%s%Creset%C(red)%d%Creset %C(blue)[%an]" --graph --decorate --date=short'
%h: abbreviated commit hash
%ad: author date
%s: subject
%d: ref names, like the --decorate options of git log
%an: author name
Log Example (4): Search for commits by a particular author
git hist --author="administrator"
OR
git log --author="administrator" --oneline
ce0341f added featureB
757ca44 modified temp.tmp file
c01d07a added featureB
3aec5b7 added temp info from admin user
13d556e added temp info
33b6e04 modified db.log file as admin user
Log Example (5): Include which files were altered and the relative number of lines that were added or deleted from each of them.
git log --stat
git log --n 3 --stat
commit fb5d4eeb0a9be6a0e0c084ba51fd0308529c343e (HEAD -> master)
Merge: 34a4e65 43d4441
Author: divya <divya@developer.com>
Date: Wed Aug 22 12:17:19 2018 +0530
Merge branch 'master' of https://github.com/greets/myProj
commit 34a4e658489c99a2c42d1edf14c7c1d695df131a
Author: greets <developer2@github.com>
Date: Mon Dec 18 04:53:04 2017 -0800
Update README to version 3.3
README.md | 1 +
1 file changed, 1 insertion(+)
commit 43d4441bb60e4dc28ce07aaa2d4c37e8416eb061 (tag: new, origin/master, origin/HEAD)
Author: greets <developer2@github.com>
Date: Mon Dec 18 04:53:04 2017 -0800
Update README to version 3.2
README.md | 1 +
1 file changed, 1 insertion(+)
Log Example (6): Shows patch difference or full diff of each commit
git log --p
git log --n 2 --p
commit fb5d4eeb0a9be6a0e0c084ba51fd0308529c343e (HEAD -> master)
Merge: 34a4e65 43d4441
Author: divya <divya@developer.com>
Date: Wed Aug 22 12:17:19 2018 +0530
Merge branch 'master' of https://github.com/greets/myProj
commit 34a4e658489c99a2c42d1edf14c7c1d695df131a
Author: greets <developer2@github.com>
Date: Mon Dec 18 04:53:04 2017 -0800
Update README to version 3.3
diff --git a/README.md b/README.md
index c6f6cd4..14b4f8c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
# myProj
+#Version 3.3
This Project is created to get a good hands-on for the git development. You could edit this project locally working on your machine.
Log Example (7): Search for commits with a commit message that matches the grep pattern
git log --grep="hotfix"
git log --oneline --grep="iss53"
078f9f5 Merged iss53 into master after resolving conflict
ab3a5e5 Modified editInfo from iss53 branch
b777b16 modified editInfo from iss53 branch
Log Example (8): See if there’s any commits that have not been pushed to your origin remote.
#read this as: show the commits missing in origin, present in HEAD
git log origin..HEAD
commit fb5d4eeb0a9be6a0e0c084ba51fd0308529c343e (HEAD -> master)
Merge: 34a4e65 43d4441
Author: divya <divya@developer.com>
Date: Wed Aug 22 12:17:19 2018 +0530
Merge branch 'master' of https://github.com/greets/myProj
commit 34a4e658489c99a2c42d1edf14c7c1d695df131aAuthor: greets <developer2@github.com>
Date: Mon Dec 18 04:53:04 2017 -0800
Update README to version 3.3
Log Example (9): Show commit logs missing in master, present in ‘topicBranch’ branch
git log --oneline master..topicBranch
commit 5d1e3baa9b790e3ce46cfc48499177c895ddbfb6 (topicBranch)
Author: divya <divya@developer.com>
Date: Thu Sep 6 14:47:11 2018 +0530
added runtest.t from featureB_old branch.
Log Example (10): commits that affected only a single file
git log <file>
git log .gitignore
commit db263a6d1968d917c36688c34263980de591c040
Author: divya <divya@developer.com>
Date: Sat Feb 28 12:38:28 2015 +0530
pattern change in .gitignore file
commit fa676058abbfe61cb751d315a9942200e180020f
Author: divya <divya@developer.com>
Date: Sat Feb 28 10:30:33 2015 +0530
add the local .gitignore file
Log Example (11): logs after, before, after-before a period
git log --after=”2015-02-27” -n2
git log --before=”2015-02-27”
git log --after="2017-12-01" --before="2018-07-01"
Log Example (12): Logs since a certain period
git log --since=”1 week ago”
git log --since=”yesterday”
git log --since=2.weeks -commit made in last 2 weeks
git log --since=1.day - commit made in last 1 day
git log --since=30.minutes - commit made in last 30 minutes
git log --since=5.hours - commit made in last 5 hours
git log --since=5.hours --pretty=oneline
Log Example (13): 38e1ee80583 (HEAD -> m
git log <since>..<until>
git log --since=4.months --until=2.weeks
git log --since="1 week ago" --until="yesterday"
Log Example (14): Display the logs between the commits with commit Ids
git log --oneline 8b92ffc.. 43d4441
43d4441 (tag: new, origin/master, origin/HEAD) Update README to version 3.2
0f491ba (origin/issue) Merge branch 'master' of https://github.com/greets/myProj
904ce2b Create README file

Diagram: ‘git diff’ between 3 layers of git workflow

git diff
git diff --cached
git diff HEAD
Project: proj_workFlow

- edit your code in working directory
- add your code to the staging area(index)
- commit the code to local repository
Git provide “git” commands to delete, rename and move files and directories.
git rm: Remove files from the working tree and from the index. Unlike ‘mv’ command ‘git rm’ will not remove a file from just your working directory.
git mv: Move or rename a file, a directory, or a symlink both in Working directory and Index.

cd proj_workFlow
git mv README.file README
git rm codes/mycode.sh
git mv temp/file.tmp .
git status

On branch initialBranch
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: README.file -> README
deleted: codes/mycode.sh
renamed: temp/file.tmp -> file.tmp
In certain cases you might need to ignore certain file types from being tracked and uploaded in the repository, such as compiled sources (.class, .dll..), Database log files(.sql, .log), packages(.7z, .gz, .jar, .tar etc), temporary OS generated files etc.
Git provides “.gitignore” file wherein you can mention the regex format for the filetypes you want git to ignore.
a) Create a local .gitignore file: vi .gitignore
b) Create a global .gitignore
Create a file under home directory of the user
vi ~/.gitignore_global
Define the file path under global config file.
git config --global core.excludesfile ~/.gitignore_global
c) Repository personal ignore file on local computer
vi .git/info/exclude
#Sample ignore patterns:
vi .gitignore
vi ~/.gitignore_global
vi .git/info/exclude
*.tmp -- ignore all files ending with tmp extension
*.[oa] -- all files ending with extension ‘o’ and ‘a’
*.exe -- ignore all files ending with exe
[tT]emp*.[oa] -- all files starting with temp or Temp and ending with an ‘o’ or ‘a’
[aA-zZ0-9]*
/test* -- Ignore filenames that start with a test - forward slash means beginning of path
temp/**/* -- Ignore all files under temp directory recursively
temp/**/*.tmp -- Ignore only *.tmp extension files under temp directory recursively
temp/*.tmp -- Ignore *.tmp files only under temp directory and not sub-directories
temp/* -- Ignore all files under dir temp