SlideShare a Scribd company logo
1 of 41
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

Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | Edureka
Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | EdurekaAzure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | Edureka
Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | EdurekaEdureka!
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsAri LiVigni
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...Edureka!
 
Getting Started with Azure DevOps
Getting Started with Azure DevOpsGetting Started with Azure DevOps
Getting Started with Azure DevOpsJessica Deen
 
[JAZUG Tohoku Azure DevOps] Azure DevOps
[JAZUG Tohoku Azure DevOps] Azure DevOps[JAZUG Tohoku Azure DevOps] Azure DevOps
[JAZUG Tohoku Azure DevOps] Azure DevOpsNaoki (Neo) SATO
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101Hazzim Anaya
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaEdureka!
 
0 to hero with Azure DevOps
0 to hero with Azure DevOps0 to hero with Azure DevOps
0 to hero with Azure DevOpsChristos Matskas
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineRobert McDermott
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Janusz Nowak
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps Chetan Gordhan
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
 

What's hot (20)

Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | Edureka
Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | EdurekaAzure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | Edureka
Azure DevOps Tutorial | Developing CI/ CD Pipelines On Azure | Edureka
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and Jenkins
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Getting Started with Azure DevOps
Getting Started with Azure DevOpsGetting Started with Azure DevOps
Getting Started with Azure DevOps
 
DevOps
DevOpsDevOps
DevOps
 
[JAZUG Tohoku Azure DevOps] Azure DevOps
[JAZUG Tohoku Azure DevOps] Azure DevOps[JAZUG Tohoku Azure DevOps] Azure DevOps
[JAZUG Tohoku Azure DevOps] Azure DevOps
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
 
0 to hero with Azure DevOps
0 to hero with Azure DevOps0 to hero with Azure DevOps
0 to hero with Azure DevOps
 
An introduction to DevOps
An introduction to DevOpsAn introduction to DevOps
An introduction to DevOps
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 

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 pipelineElasTest Project
 
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
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram 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
 
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 GitGeoff Hoffman
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
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 DocumentationLavaCon
 
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 GitHubBigBlueHat
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis 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 CommandsJeremy Lindblom
 
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 Gitcmckni3
 

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

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 EthereumMurughan 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 EthereumMurughan Palaniachari
 
DevOps continuous learning and experimentation
DevOps continuous learning and experimentationDevOps continuous learning and experimentation
DevOps continuous learning and experimentationMurughan 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 azureMurughan Palaniachari
 
DevOps the phoenix project simulation
DevOps the phoenix project simulationDevOps the phoenix project simulation
DevOps the phoenix project simulationMurughan 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 organizationMurughan 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 DeliveryMurughan Palaniachari
 
DevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowDevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowMurughan 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

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

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