SlideShare a Scribd company logo
Git Version
Control and
Trunk based
with VSTS
Murughan Palaniachari
Murughan Palaniachari
Principal Consultant – DevOps and Blockchain
Organizer of
Cloud and DevOps meetup
Technical Agility Conference
http://aidevdays.com/
http://www.containerconf.in/
https://elevate-org.com/
https://devopsgames.com/
https://in.linkedin.com/in/murughan
@Murughan_P
With my Guru – John Willis & Jez Humble
Products/Services
TFS/VSTS
+ Azure
@Murughan_P
What is Visual
Studio Team
Services?
• It’s a source control system!
• Wrong. It is FAR more than a source control
system.
• Everything you need to create software.
From application inception to application sun
setting.
• DevOps Collaboration Hub
• Key Functional Areas
• Agile Planning & Management/Work Item
Tracking
• Version Control
• Build Management & Automation
• Testing
• Release Management
• Application Monitoring
@Murughan_P
REQUIREMENTS
Plan
Develop + Test Release
Business
Product Owners
Developers
Testers
Operations
+ all other
Stakeholders
Backlog
Enabling Value Delivery
@Murughan_P
Agenda –
Version Control
• Version Control Overview
• Centralized Version Control
• Distributed Version Control
• Git Overview
• Pre-requisites
• Git Installation
• Git Commands
• Branching, Merging, Rebase
• Trunk based approach
• Pull request
• Code review
• Workshop with sample Python Application
@Murughan_P
Training
Exercises
• Exercise 1: Practise Git commands – command
line
• Exercise 2: Create Git repository in VSTS, clone
it, git commands through Visual Studio
• Exercise 3: Trunk based approach, create
branch, create pull request and approve.
• Exercise 4: Unit testing with Unittest python
for sample Phonebook app
• Exercise 5: Mock data with Unittest Mock
package python for sample bank accounts app
• Exercise 6: TDD for sample Calculator app
• Demo: UI Testing with Selenium Web Driver
python
@Murughan_P
Version
Control
@Murughan_Phttps://app.pluralsight.com/library/courses/tfs-visual-studio-2015-implementing-continuous-delivery/table-of-contents
Version Control
• Version Control as Fundamental Enabler of Continuous Delivery
• One single source of truth for everything
• Manage your daily tasks
• Create
• Save
• Edit
• Save again
• Collaborative History tracking
• What changes
• Why was things changed – comments
• Compare the changes
• Who has made change
https://git-scm.com/ @Murughan_P
Centralized Version Control
@Murughan_P
Git - Distributed Version Control
• Git is a fast and modern implementation of Version Control
• Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.
• Git provides a history of content changes
• Git facilitates Collaborative Changes to files
• East to use for anyone and any knowledge worker
• Local Git
• Easy to learn
https://git-scm.com/ @Murughan_P
Git - Distributed Version Control
https://app.pluralsight.com/library/courses/tfs-visual-studio-2015-implementing-continuous-delivery/table-of-contents
@Murughan_P
Principle - Keep everything in Source Control
https://www.edx.org/course/introduction-devops-transforming-linuxfoundationx-lfs161x @Murughan_P
Git Installation
• Windows
• https://git-scm.com/downloads
• Mac OSX
• https://git-scm.com/download/mac
• Linux
• https://git-
scm.com/download/linux
@Murughan_P
The Three States committed, modified, and staged
• Committed means that
the data is safely stored in
your local database.
• Modified means that you
have changed the file but
have not committed it to
your database yet.
• Staged means that you
have marked a modified
file in its current version to
go into your next commit
snapshot.
https://git-scm.com/book/en/v2/Getting-Started-Git-Basics @Murughan_P
Exercise 1
Practise Git commands – command line
@Murughan_P
Git commands list
• git
• git --version
• Prints the Git suite version that
the git program came from.
• git --help
• Prints the synopsis and a list of
the most commonly used
commands. Ex: git --help merge
https://git-scm.com/docs/git @Murughan_P
Configuring Git
Git comes with a tool called git config that
lets you get and set configuration variables
that control all aspects of how Git looks and
operates.
• System-level configuration
• git config --system
• Stored in /etc/gitconfig or
c:Program Files
(x86)Gitetcgitconfig
• User-level configuration
• git config --global
• Stored in ~/.gitconfig or
c:Users<NAME>.gitconfig
@Murughan_P
Configuring Git
• Repository-level configuration
• git config
• Stored in .git/config in each repo
• Set Identity
• git config --global user.name "John
Doe"
• git config --global user.email
johndoe@example.com
• Check your seetings
• git config --list
@Murughan_P
Git commands
• Creating a local repository
• git init sampleproject
• cd sampleproject
• Open this folder in editor and add some test files
• Adding files
• git add .
• Committing changes – local commit
• git commit -m "Creating sample project“
• Cloning app
• Git clone https://github.com/murughan1985/pythonSample.git
@Murughan_P
STAGE &
SNAPSHOT
Working with snapshots and the Git staging area
• git add [file]
• add a file as it looks now to your next commit
(stage)
• git status
• show modified files in working directory, staged
for your next commit
• git reset [file]
• unstage a file while retaining the changes in
working directory
• git diff //modify the test file
• - diff of what is changed but not staged
• git diff –staged
• diff of what is staged but not yet commited
• git commit -m “[descriptive message]”
• commit your staged content as a new commit
snapshot
@Murughan_P
Log
@Murughan_P
• show the commit history for the currently active branchgit log
• show the commits on branchA that are not on branchBgit log branchB..branchA
• show the commits that changed file, even across renamesgit log --follow [file]
• show the diff of what is in branchA that is not in branchBgit diff branchB...branchA
• show any object in Git in human-readable formatgit show [SHA]
Exercise 2
Create Git repository in VSTS, clone it, git commands
through Visual Studio
@Murughan_P
VSTS – Git tab
• Repository
• Create New Repository
• Import New repository
• Manage Repository
• Clone and Fork
• Files
• Content
• History
• Commits
• Pushes
• Tags
https://www.youtube.com/watch?v=ykZbBD-CmP8 @Murughan_P
Github – Create python Django project from visual studio and push
it to github
Workshop
Check out my blogpost on this
https://elevate-org.com/2018/05/13/create-python-django-project-from-visual-studio-and-
push-it-to-github/
@Murughan_P
SHARE & UPDATE
@Murughan_P
• add a git URL as an aliasgit remote add [alias] [url]
• fetch down all the branches from that Git remotegit fetch [alias]
• merge a remote branch into your current branch to bring it up to dategit merge [alias]/[branch]
• Transmit local branch commits to the remote repository branchgit push [alias] [branch]
• fetch and merge any commits from the tracking remote branchgit pull
TRACKING PATH CHANGES
@Murughan_P
• delete the file from project and stage the removal for
commitgit rm [file]
• change an existing file path and stage the move
git mv [existing-path]
[new-path]
• show all commit logs with indication of any paths
that movedgit log --stat -M
Git commands
• Branch
• git branch feature1
• Merge changes to master
• git merge sampleproject
• Rebase - you can take all the changes
that were committed on one branch
and replay them on another one.
• git checkout fature1
• git rebase master
• Stage - Add file contents to the staging
area
• git stage
@Murughan_P
Create VSTS
project and Git
repository.
Workshop
Check out my blogpost on this
https://elevate-
org.com/2018/05/13/configure-git-
version-control-in-vsts-and-create-push-
python-django-project-through-visual-
studio/
@Murughan_P
Branching and
Merging
• Branching means you diverge from the main
line of development and continue to do work
without messing with that main line.
• The way Git branches is incredibly lightweight,
making branching operations nearly
instantaneous, and switching back and forth
between branches generally just as fast.
• Below command create branch called feature1
from master
• git branch feature1
• Merging Join two or more development
histories together
• git merge feature1
• Staging Add file contents to the staging area
@Murughan_P
Feature Branching
@Murughan_Phttps://continuousdelivery.com/
Branch Types
@Murughan_P
Trunk based
approach
• A source-control branching model,
where developers collaborate on
code in a single branch called ‘trunk’.
• Resist any pressure to create other
long-lived development branches by
employing documented techniques.
• They therefore avoid merge hell, do
not break the build, and live happily
ever after.
@Murughan_Phttps://trunkbaseddevelopment.com/
Continuous Integration
@Murughan_Phttps://continuousdelivery.com/
Feature
Branch vs
Continuous
Integration
@Murughan_Phttps://continuousdelivery.com/
Continuous
Integration
Principle
@Murughan_P
BRANCH &
MERGE
Isolating work in branches, changing context, and
integrating changes
• git branch
• list your branches. a * will appear next to the
currently active branch
• git branch [branch-name]
• create a new branch at the current commit
• git checkout
• switch to another branch and check it out
into your working directory
• git merge [branch]
• merge the specified branch’s history into the
current one
• git log
• show all commits in the current branch’s
history
@Murughan_P
Pull request
• The pull request is the collaborative process that lets the rest
of the team discuss changes in a branch and agree to merge
them once everyone approves. Use pull requests to get early
feedback from others on work in progress, even if you're not
ready to merge the changes into another branch.
• In this image, the purple branch is merged into the blue branch
through a pull request. The changes are discussed by reviewers
in the pull request before the code is merged. When you
complete the pull request, there is a merge commit (seen here
as the filled blue commit) where the changes in the purple
branch are now merged in the blue branch.
@Murughan_P
Exercise 3
Trunk based approach, create branch,
create pull request and approve with
VSTS and Visual Studio
@Murughan_P
VSTS – Branches, Pull request
• Branches
• New Branch
• Branch Policy
• Pull request
• Create
• Approve
• Modify code
@Murughan_P
Reference/Further reading
• https://git-scm.com/docs/git
• https://trunkbaseddevelopment.com/
• https://continuousdelivery.com/
• https://app.pluralsight.com/library/courses/tfs-visual-studio-2015-implementing-
continuous-delivery/table-of-contents
• https://elevate-org.com

More Related Content

What's hot

Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
Lemi Orhan Ergin
 
Git
GitGit
git and github
git and githubgit and github
git and github
Darren Oakley
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Rueful Robin
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
viniciusban
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
GoogleDevelopersStud1
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
David Paluy
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020
Noa Harel
 
Version control
Version controlVersion control
Version control
Shahriar Iqbal Chowdhury
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
Jeremy Coates
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
Suman Mukherjee
 
Unbreakable VPN using Vyatta/VyOS - HOW TO -
Unbreakable VPN using Vyatta/VyOS - HOW TO -Unbreakable VPN using Vyatta/VyOS - HOW TO -
Unbreakable VPN using Vyatta/VyOS - HOW TO -
Naoto MATSUMOTO
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Git flow
Git flowGit flow
Git flow
Valerio Como
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 

What's hot (20)

Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Git
GitGit
Git
 
git and github
git and githubgit and github
git and github
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Version control
Version controlVersion control
Version control
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Unbreakable VPN using Vyatta/VyOS - HOW TO -
Unbreakable VPN using Vyatta/VyOS - HOW TO -Unbreakable VPN using Vyatta/VyOS - HOW TO -
Unbreakable VPN using Vyatta/VyOS - HOW TO -
 
Learning git
Learning gitLearning git
Learning git
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git flow
Git flowGit flow
Git flow
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 

Similar to Git version control and trunk based approach with VSTS

How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
ElasTest Project
 
git Technologies
git Technologiesgit Technologies
git Technologies
Hirantha Pradeep
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
Bruno Capuano
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
Sridhar Peddinti
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
KeerthanaJ32
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source Documentation
LavaCon
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
Edward Goikhman
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
Luis Atencio
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
Jeremy Lindblom
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
Chris Ballance
 
Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)
Ciro Miranda
 
Fundamentals of Git
Fundamentals of GitFundamentals of Git
Fundamentals of Git
cmckni3
 
Git & Github
Git & GithubGit & Github
Git & Github
Aman Lalpuria
 

Similar to Git version control and trunk based approach with VSTS (20)

How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source Documentation
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)Git basics, Team Workflows (Ciro Miranda)
Git basics, Team Workflows (Ciro Miranda)
 
Fundamentals of Git
Fundamentals of GitFundamentals of Git
Fundamentals of Git
 
Git & Github
Git & GithubGit & Github
Git & Github
 

More from Murughan Palaniachari

Blockchain on aws
Blockchain on awsBlockchain on aws
Blockchain on aws
Murughan Palaniachari
 
Hyperledger Fabric
Hyperledger FabricHyperledger Fabric
Hyperledger Fabric
Murughan Palaniachari
 
Azure Blockchain Workbench
Azure Blockchain WorkbenchAzure Blockchain Workbench
Azure Blockchain Workbench
Murughan Palaniachari
 
Create and Deploy your ERC20 token with Ethereum
Create and Deploy your ERC20 token with EthereumCreate and Deploy your ERC20 token with Ethereum
Create and Deploy your ERC20 token with Ethereum
Murughan Palaniachari
 
Agile scrum with Microsoft VSTS
Agile scrum with Microsoft VSTSAgile scrum with Microsoft VSTS
Agile scrum with Microsoft VSTS
Murughan Palaniachari
 
Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
Murughan Palaniachari
 
DevOps culture
DevOps cultureDevOps culture
DevOps culture
Murughan Palaniachari
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
Murughan Palaniachari
 
DevOps continuous learning and experimentation
DevOps continuous learning and experimentationDevOps continuous learning and experimentation
DevOps continuous learning and experimentation
Murughan Palaniachari
 
DevOps ci/cd with Microsoft vsts and azure
DevOps ci/cd with Microsoft vsts and azureDevOps ci/cd with Microsoft vsts and azure
DevOps ci/cd with Microsoft vsts and azure
Murughan Palaniachari
 
DevOps the phoenix project simulation
DevOps the phoenix project simulationDevOps the phoenix project simulation
DevOps the phoenix project simulation
Murughan Palaniachari
 
Dev ops culture and principles of high performing organization
Dev ops culture and principles of high performing organizationDev ops culture and principles of high performing organization
Dev ops culture and principles of high performing organization
Murughan Palaniachari
 
DevOps culture in high performing organization and adoption & growth of DevOps
DevOps culture in high performing organization and adoption & growth of DevOps DevOps culture in high performing organization and adoption & growth of DevOps
DevOps culture in high performing organization and adoption & growth of DevOps
Murughan Palaniachari
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous Delivery
Murughan Palaniachari
 
DevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowDevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flow
Murughan Palaniachari
 
DevOps game marshmallow challenge
DevOps game marshmallow challengeDevOps game marshmallow challenge
DevOps game marshmallow challenge
Murughan Palaniachari
 
DevOps game lego
DevOps game legoDevOps game lego
DevOps game lego
Murughan Palaniachari
 
Top 10 devops values
Top 10 devops valuesTop 10 devops values
Top 10 devops values
Murughan Palaniachari
 

More from Murughan Palaniachari (18)

Blockchain on aws
Blockchain on awsBlockchain on aws
Blockchain on aws
 
Hyperledger Fabric
Hyperledger FabricHyperledger Fabric
Hyperledger Fabric
 
Azure Blockchain Workbench
Azure Blockchain WorkbenchAzure Blockchain Workbench
Azure Blockchain Workbench
 
Create and Deploy your ERC20 token with Ethereum
Create and Deploy your ERC20 token with EthereumCreate and Deploy your ERC20 token with Ethereum
Create and Deploy your ERC20 token with Ethereum
 
Agile scrum with Microsoft VSTS
Agile scrum with Microsoft VSTSAgile scrum with Microsoft VSTS
Agile scrum with Microsoft VSTS
 
Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
 
DevOps culture
DevOps cultureDevOps culture
DevOps culture
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
DevOps continuous learning and experimentation
DevOps continuous learning and experimentationDevOps continuous learning and experimentation
DevOps continuous learning and experimentation
 
DevOps ci/cd with Microsoft vsts and azure
DevOps ci/cd with Microsoft vsts and azureDevOps ci/cd with Microsoft vsts and azure
DevOps ci/cd with Microsoft vsts and azure
 
DevOps the phoenix project simulation
DevOps the phoenix project simulationDevOps the phoenix project simulation
DevOps the phoenix project simulation
 
Dev ops culture and principles of high performing organization
Dev ops culture and principles of high performing organizationDev ops culture and principles of high performing organization
Dev ops culture and principles of high performing organization
 
DevOps culture in high performing organization and adoption & growth of DevOps
DevOps culture in high performing organization and adoption & growth of DevOps DevOps culture in high performing organization and adoption & growth of DevOps
DevOps culture in high performing organization and adoption & growth of DevOps
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous Delivery
 
DevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowDevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flow
 
DevOps game marshmallow challenge
DevOps game marshmallow challengeDevOps game marshmallow challenge
DevOps game marshmallow challenge
 
DevOps game lego
DevOps game legoDevOps game lego
DevOps game lego
 
Top 10 devops values
Top 10 devops valuesTop 10 devops values
Top 10 devops values
 

Recently uploaded

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Git version control and trunk based approach with VSTS

  • 1. Git Version Control and Trunk based with VSTS Murughan Palaniachari
  • 2. Murughan Palaniachari Principal Consultant – DevOps and Blockchain Organizer of Cloud and DevOps meetup Technical Agility Conference http://aidevdays.com/ http://www.containerconf.in/ https://elevate-org.com/ https://devopsgames.com/ https://in.linkedin.com/in/murughan @Murughan_P With my Guru – John Willis & Jez Humble
  • 4. What is Visual Studio Team Services? • It’s a source control system! • Wrong. It is FAR more than a source control system. • Everything you need to create software. From application inception to application sun setting. • DevOps Collaboration Hub • Key Functional Areas • Agile Planning & Management/Work Item Tracking • Version Control • Build Management & Automation • Testing • Release Management • Application Monitoring @Murughan_P
  • 5. REQUIREMENTS Plan Develop + Test Release Business Product Owners Developers Testers Operations + all other Stakeholders Backlog Enabling Value Delivery @Murughan_P
  • 6. Agenda – Version Control • Version Control Overview • Centralized Version Control • Distributed Version Control • Git Overview • Pre-requisites • Git Installation • Git Commands • Branching, Merging, Rebase • Trunk based approach • Pull request • Code review • Workshop with sample Python Application @Murughan_P
  • 7. Training Exercises • Exercise 1: Practise Git commands – command line • Exercise 2: Create Git repository in VSTS, clone it, git commands through Visual Studio • Exercise 3: Trunk based approach, create branch, create pull request and approve. • Exercise 4: Unit testing with Unittest python for sample Phonebook app • Exercise 5: Mock data with Unittest Mock package python for sample bank accounts app • Exercise 6: TDD for sample Calculator app • Demo: UI Testing with Selenium Web Driver python @Murughan_P
  • 9. Version Control • Version Control as Fundamental Enabler of Continuous Delivery • One single source of truth for everything • Manage your daily tasks • Create • Save • Edit • Save again • Collaborative History tracking • What changes • Why was things changed – comments • Compare the changes • Who has made change https://git-scm.com/ @Murughan_P
  • 11. Git - Distributed Version Control • Git is a fast and modern implementation of Version Control • Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. • Git provides a history of content changes • Git facilitates Collaborative Changes to files • East to use for anyone and any knowledge worker • Local Git • Easy to learn https://git-scm.com/ @Murughan_P
  • 12. Git - Distributed Version Control https://app.pluralsight.com/library/courses/tfs-visual-studio-2015-implementing-continuous-delivery/table-of-contents @Murughan_P
  • 13. Principle - Keep everything in Source Control https://www.edx.org/course/introduction-devops-transforming-linuxfoundationx-lfs161x @Murughan_P
  • 14. Git Installation • Windows • https://git-scm.com/downloads • Mac OSX • https://git-scm.com/download/mac • Linux • https://git- scm.com/download/linux @Murughan_P
  • 15. The Three States committed, modified, and staged • Committed means that the data is safely stored in your local database. • Modified means that you have changed the file but have not committed it to your database yet. • Staged means that you have marked a modified file in its current version to go into your next commit snapshot. https://git-scm.com/book/en/v2/Getting-Started-Git-Basics @Murughan_P
  • 16. Exercise 1 Practise Git commands – command line @Murughan_P
  • 17. Git commands list • git • git --version • Prints the Git suite version that the git program came from. • git --help • Prints the synopsis and a list of the most commonly used commands. Ex: git --help merge https://git-scm.com/docs/git @Murughan_P
  • 18. Configuring Git Git comes with a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates. • System-level configuration • git config --system • Stored in /etc/gitconfig or c:Program Files (x86)Gitetcgitconfig • User-level configuration • git config --global • Stored in ~/.gitconfig or c:Users<NAME>.gitconfig @Murughan_P
  • 19. Configuring Git • Repository-level configuration • git config • Stored in .git/config in each repo • Set Identity • git config --global user.name "John Doe" • git config --global user.email johndoe@example.com • Check your seetings • git config --list @Murughan_P
  • 20. Git commands • Creating a local repository • git init sampleproject • cd sampleproject • Open this folder in editor and add some test files • Adding files • git add . • Committing changes – local commit • git commit -m "Creating sample project“ • Cloning app • Git clone https://github.com/murughan1985/pythonSample.git @Murughan_P
  • 21. STAGE & SNAPSHOT Working with snapshots and the Git staging area • git add [file] • add a file as it looks now to your next commit (stage) • git status • show modified files in working directory, staged for your next commit • git reset [file] • unstage a file while retaining the changes in working directory • git diff //modify the test file • - diff of what is changed but not staged • git diff –staged • diff of what is staged but not yet commited • git commit -m “[descriptive message]” • commit your staged content as a new commit snapshot @Murughan_P
  • 22. Log @Murughan_P • show the commit history for the currently active branchgit log • show the commits on branchA that are not on branchBgit log branchB..branchA • show the commits that changed file, even across renamesgit log --follow [file] • show the diff of what is in branchA that is not in branchBgit diff branchB...branchA • show any object in Git in human-readable formatgit show [SHA]
  • 23. Exercise 2 Create Git repository in VSTS, clone it, git commands through Visual Studio @Murughan_P
  • 24. VSTS – Git tab • Repository • Create New Repository • Import New repository • Manage Repository • Clone and Fork • Files • Content • History • Commits • Pushes • Tags https://www.youtube.com/watch?v=ykZbBD-CmP8 @Murughan_P
  • 25. Github – Create python Django project from visual studio and push it to github Workshop Check out my blogpost on this https://elevate-org.com/2018/05/13/create-python-django-project-from-visual-studio-and- push-it-to-github/ @Murughan_P
  • 26. SHARE & UPDATE @Murughan_P • add a git URL as an aliasgit remote add [alias] [url] • fetch down all the branches from that Git remotegit fetch [alias] • merge a remote branch into your current branch to bring it up to dategit merge [alias]/[branch] • Transmit local branch commits to the remote repository branchgit push [alias] [branch] • fetch and merge any commits from the tracking remote branchgit pull
  • 27. TRACKING PATH CHANGES @Murughan_P • delete the file from project and stage the removal for commitgit rm [file] • change an existing file path and stage the move git mv [existing-path] [new-path] • show all commit logs with indication of any paths that movedgit log --stat -M
  • 28. Git commands • Branch • git branch feature1 • Merge changes to master • git merge sampleproject • Rebase - you can take all the changes that were committed on one branch and replay them on another one. • git checkout fature1 • git rebase master • Stage - Add file contents to the staging area • git stage @Murughan_P
  • 29. Create VSTS project and Git repository. Workshop Check out my blogpost on this https://elevate- org.com/2018/05/13/configure-git- version-control-in-vsts-and-create-push- python-django-project-through-visual- studio/ @Murughan_P
  • 30. Branching and Merging • Branching means you diverge from the main line of development and continue to do work without messing with that main line. • The way Git branches is incredibly lightweight, making branching operations nearly instantaneous, and switching back and forth between branches generally just as fast. • Below command create branch called feature1 from master • git branch feature1 • Merging Join two or more development histories together • git merge feature1 • Staging Add file contents to the staging area @Murughan_P
  • 33. Trunk based approach • A source-control branching model, where developers collaborate on code in a single branch called ‘trunk’. • Resist any pressure to create other long-lived development branches by employing documented techniques. • They therefore avoid merge hell, do not break the build, and live happily ever after. @Murughan_Phttps://trunkbaseddevelopment.com/
  • 37. BRANCH & MERGE Isolating work in branches, changing context, and integrating changes • git branch • list your branches. a * will appear next to the currently active branch • git branch [branch-name] • create a new branch at the current commit • git checkout • switch to another branch and check it out into your working directory • git merge [branch] • merge the specified branch’s history into the current one • git log • show all commits in the current branch’s history @Murughan_P
  • 38. Pull request • The pull request is the collaborative process that lets the rest of the team discuss changes in a branch and agree to merge them once everyone approves. Use pull requests to get early feedback from others on work in progress, even if you're not ready to merge the changes into another branch. • In this image, the purple branch is merged into the blue branch through a pull request. The changes are discussed by reviewers in the pull request before the code is merged. When you complete the pull request, there is a merge commit (seen here as the filled blue commit) where the changes in the purple branch are now merged in the blue branch. @Murughan_P
  • 39. Exercise 3 Trunk based approach, create branch, create pull request and approve with VSTS and Visual Studio @Murughan_P
  • 40. VSTS – Branches, Pull request • Branches • New Branch • Branch Policy • Pull request • Create • Approve • Modify code @Murughan_P
  • 41. Reference/Further reading • https://git-scm.com/docs/git • https://trunkbaseddevelopment.com/ • https://continuousdelivery.com/ • https://app.pluralsight.com/library/courses/tfs-visual-studio-2015-implementing- continuous-delivery/table-of-contents • https://elevate-org.com