SlideShare a Scribd company logo
GIT HANDS-ON WORKSHOP
VCS FOR TEAMWORK
SOFTWARE DEVELOPMENT BOOTCAMP
BY DEVNET LIMITED
AT INTERNATIONAL ISLAMIC UNIVERSITY CHITTAGONG
15th-16th Nov, 2019
ANIS UDDIN AHMAD
WHO AM I
Head of Software Development
Devnet Limited
WHY ARE WE HERE?
THE PROBLEM STATEMENT
SCENARIOS IN SOFTWARE DEVEOPMENT
▸ How can multiple developers work in parallel?
▸ How can we revert back to an older version of
project?
▸ How can we explore change history of code?
VCS TO RESCUE…
WHAT IS THAT BTW?
VERSION CONTROL SYSTEM
▸ Manage changes to source code over time
▸ Keeps track of every modification to the code
▸ Compare earlier versions and revert (if required)
▸ Helps in collaboration and distribution
DISTRIBUTED VERSION CONTROLS SYSTEM
DISTRIBUTED VERSION CONTROLS SYSTEM
* SPOILER ALERT: YOU HAVE TO LEARN IT - TODAY OR TOMORROW!
BASIC CONCEPTS
BASIC CONCEPTS
GIT REPOSITORY
‣ A folder in your source directory
‣ Can be tracked with a remote repository
BASIC CONCEPTS
INIT AND CLONE
‣ init starts a GIT repository in a directory
‣ clone create a repository from a remote repository
BASIC CONCEPTS
STAGING
‣ Add new files in GIT’s tracking
‣ Adding Updates of already added files
BASIC CONCEPTS
COMMIT
‣ Create a Snapshot of current (staged) files
‣ Can be shared with other repository
BASIC CONCEPTS
STATUS AND LOG
‣ status shows the current repository status
‣ log shows the history - who/what/when/where
BASIC CONCEPTS
PUSH AND PULL
‣ push submits local commits to remote repo
‣ pull receives new commits from remote repo
BASIC CONCEPTS
BRANCHING
‣ branches are isolated streams of commits
‣ Your default/only branch is called master branch
BASIC CONCEPTS
MERGING
‣ Take changes of source branch and Integrates into
target branch
‣ The way of joining change sets of different branches
HANDS-ON EXPERIENCE
LET’S GET SOME
GET PREPARED
INSTALL GIT
sudo apt-get install git
git —-version
PREPARE LOCAL REPOSITORY
INITIATE A REPOSITORY
mkdir my_git_project
cd my_git_project
git init
PREPARE LOCAL REPOSITORY
CONFIGURE
git config --global user.name ‘Your Name'
git config --global user.email ‘your-name@domain.com'
git config --global color.ui ‘auto'
ADD YOUR HARD WORK TO GIT
STAGING AND COMMIT
git status
DO SOME WORK. CREATE FILES. THEN..
ADD YOUR HARD WORK TO GIT
ADD FILES TO GIT
git add my_file1 my_file2 my_file3
git add .
git status
ADD YOUR HARD WORK TO GIT
REMOVING FILES FROM STAGE
git rm —-cached my_file2
git status
ADD YOUR HARD WORK TO GIT
COMMIT A CHANGE SET
git commit -m "My first commit"
CONTINUE ADDING CHANGES… AND CHECK THE TRACE
CHECK THE CHANGE HISTORY
git log
git diff
git diff commit-hash1 commit-hash12
STARTING TEAMWORK
LET’S GO CLOUD
CREATE AN ACCOUNT
HTTPS://GITHUB.COM/
CLONE THE REPOSITORY
HTTPS://GITHUB.COM/AJAXRAY/IIUC-GIT-WORKSHOP
mkdir git_workshop
cd git_workshop
git clone https://github.com/ajaxray/iiuc-git-workshop.git .
Share your GitHub account ID
THIS IS WHAT YOU HAVE NOW
php -S localhost:8084
START CONTRIBUTING
CREATE YOUR FILES
‣ Copy teams/devnet.html and create file with your team name
START CONTRIBUTING
ADD YOUR FILES TO GIT
# After adding files in directory
git status
git add teams/<team-name>.html
git status
git log --graph --all
‣ Change Team name, Description and team members.
‣ Add the file to git
CREATE A SNAPSHOT OF THE PROGRESS
COMMIT YOUR HARD WORK
git commit -m “The new feature”
# After adding files in git
# To add updates of already added file, you may
git commit -am “The important updates here”
git log --graph --all
SUBMIT YOUR CONTRIBUTION
PUSH TO REMOTE REPOSITORY
# Get the updates from server first
git pull
# Now submit your commits to remote repository
git push
git push [origin] [master]
GET THE UPDATES AND CHECK PROGRESS
CHECK WHAT WE HAVE DONE SO FAR
# Get the updates from server first
git pull
git log --graph --all
php -S localhost:8084
‣ Now check your (and other teams) team name on sidebar
‣ Click on team names to what they have done
MULTIPLE DEVELOPERS WORKING ON SAME BRANCH
EXPERIMENT: AUTO-MERGE
‣ You are working on same branch
‣ Someone pushed some changes after your last pull
DIFFERENT TEAMS/DEVS ARE WORKING ON DIFFERENT FEATURE
BRANCHING FOR ISOLATED FEATURES
# See List of available branches
git branch
# Create and switch to branch
git branch [branch_name]
git checkout [branch_name]
# Create and immediately switch to new branch
git checkout -b [branch_name]
# Check the branching state
git log --graph --all
GET THE UPDATES AND CHECK PROGRESS
BRANCHING FOR ISOLATED FEATURES
BRING YOUR AMAZING FEATURE TO LIVE
MERGE BACK YOUR COMPLETE WORK
# Add/Edit/Do whatever
commit -am "Your feature commit”
# Again Add/Edit/Do whatever
commit -am "Your feature another commit”
BRING YOUR AMAZING FEATURE TO LIVE
MERGE BACK YOUR COMPLETE WORK
# Merge changes of target branch to your branch first
git merge master
# Switch to target branch and merge your branch
git checkout master
git pull
git merge your-branch
# Submit the update
git push
QUESTIONS?

More Related Content

What's hot

What's hot (20)

Git - a powerful version control tool
Git - a powerful version control toolGit - a powerful version control tool
Git - a powerful version control tool
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
Git internals
Git internalsGit internals
Git internals
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamental
 
Git inter-snapshot public
Git  inter-snapshot publicGit  inter-snapshot public
Git inter-snapshot public
 
An introduction to git
An introduction to gitAn introduction to git
An introduction to git
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / Github
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet code
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 

Similar to VCS for Teamwork - GIT Workshop

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 

Similar to VCS for Teamwork - GIT Workshop (20)

Git
GitGit
Git
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
Git
GitGit
Git
 
Version control
Version controlVersion control
Version control
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Git
GitGit
Git
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Git
GitGit
Git
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
Using Github for DSpace development
Using Github for DSpace developmentUsing Github for DSpace development
Using Github for DSpace development
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
Git presentation
Git presentationGit presentation
Git presentation
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Git github
Git githubGit github
Git github
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 

More from Anis Ahmad

More from Anis Ahmad (8)

Testing in Laravel Framework
Testing in Laravel FrameworkTesting in Laravel Framework
Testing in Laravel Framework
 
Writing Sensible Code
Writing Sensible CodeWriting Sensible Code
Writing Sensible Code
 
Revisiting SOLID Principles
Revisiting  SOLID Principles Revisiting  SOLID Principles
Revisiting SOLID Principles
 
Building Large Scale Javascript Application
Building Large Scale Javascript ApplicationBuilding Large Scale Javascript Application
Building Large Scale Javascript Application
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Caching basics in PHP
Caching basics in PHPCaching basics in PHP
Caching basics in PHP
 
Freelancing; an alternate career
Freelancing; an alternate careerFreelancing; an alternate career
Freelancing; an alternate career
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 

Recently uploaded

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Recently uploaded (20)

Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 

VCS for Teamwork - GIT Workshop