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

PPTX
GIT presentation
PDF
Getting Git Right
PDF
Git, from the beginning
PDF
Git training v10
PDF
Git & Github for beginners
PPTX
Basic Git Intro
ZIP
Introduction to Git
PDF
Deep dark-side of git: How git works internally
GIT presentation
Getting Git Right
Git, from the beginning
Git training v10
Git & Github for beginners
Basic Git Intro
Introduction to Git
Deep dark-side of git: How git works internally

What's hot (19)

PDF
Git - a powerful version control tool
PDF
That's (g)it! par Sébastien Dawans CETIC
PDF
Github - Git Training Slides: Foundations
PDF
Introduction to Git, DrupalCamp LA 2015
PDF
Git internals
PDF
Inside GitHub with Chris Wanstrath
PDF
Git and github fundamental
PDF
Git inter-snapshot public
PDF
An introduction to git
PDF
DO YOU WANT TO USE A VCS
PPTX
Git 101 for Beginners
PPTX
Introduction to Git / Github
PPTX
Intro to git and git hub
PDF
Introduction To Git For Version Control Architecture And Common Commands Comp...
PDF
Git and Github workshop
PDF
Starting with Git & GitHub
PDF
2017 jenkins world
PDF
Git and github - Verson Control for the Modern Developer
PDF
Git: a brief introduction
Git - a powerful version control tool
That's (g)it! par Sébastien Dawans CETIC
Github - Git Training Slides: Foundations
Introduction to Git, DrupalCamp LA 2015
Git internals
Inside GitHub with Chris Wanstrath
Git and github fundamental
Git inter-snapshot public
An introduction to git
DO YOU WANT TO USE A VCS
Git 101 for Beginners
Introduction to Git / Github
Intro to git and git hub
Introduction To Git For Version Control Architecture And Common Commands Comp...
Git and Github workshop
Starting with Git & GitHub
2017 jenkins world
Git and github - Verson Control for the Modern Developer
Git: a brief introduction
Ad

Similar to VCS for Teamwork - GIT Workshop (20)

PDF
Git Init (Introduction to Git)
PPTX
PDF
Git basics
PPTX
Git Overview
PPTX
Get going with_git_ppt
PPTX
Git and Github
PDF
PPTX
Git and github
PPT
Git basic
PPTX
Git workshop 33degree 2011 krakow
PDF
Collaborative development with Git | Workshop
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
PDF
git-presentation.pdf
PDF
Git and github 101
PPTX
Learn Git - For Beginners and Intermediate levels
PPTX
Session git
PPT
Fundamentals and basics of Git and commands
PPTX
PPTX
01 - Git vs SVN
Git Init (Introduction to Git)
Git basics
Git Overview
Get going with_git_ppt
Git and Github
Git and github
Git basic
Git workshop 33degree 2011 krakow
Collaborative development with Git | Workshop
Let's Git this Party Started: An Introduction to Git and GitHub
git-presentation.pdf
Git and github 101
Learn Git - For Beginners and Intermediate levels
Session git
Fundamentals and basics of Git and commands
01 - Git vs SVN
Ad

More from Anis Ahmad (8)

PDF
Testing in Laravel Framework
PDF
Writing Sensible Code
PDF
Revisiting SOLID Principles
PDF
Building Large Scale Javascript Application
PDF
Developing cross platform desktop application with Ruby
PDF
Caching basics in PHP
PDF
Freelancing; an alternate career
PPTX
jQuery from the very beginning
Testing in Laravel Framework
Writing Sensible Code
Revisiting SOLID Principles
Building Large Scale Javascript Application
Developing cross platform desktop application with Ruby
Caching basics in PHP
Freelancing; an alternate career
jQuery from the very beginning

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administraation Chapter 3
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administraation Chapter 3
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Operating system designcfffgfgggggggvggggggggg
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PTS Company Brochure 2025 (1).pdf.......
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
history of c programming in notes for students .pptx
Odoo POS Development Services by CandidRoot Solutions
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms I-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
wealthsignaloriginal-com-DS-text-... (1).pdf

VCS for Teamwork - GIT Workshop