The slide was prepared for GIT introduction and workshop at International Islamic University Chittagong.
It was a 2 day (15th-16th Nov, 2019) Seminar and Workshop for IIUC Students by Devnet Limited.
De mooiste recreatieve routes ontdekken met RouteYou en FME
VCS for Teamwork - GIT Workshop
1. GIT HANDS-ON WORKSHOP
VCS FOR TEAMWORK
SOFTWARE DEVELOPMENT BOOTCAMP
BY DEVNET LIMITED
AT INTERNATIONAL ISLAMIC UNIVERSITY CHITTAGONG
15th-16th Nov, 2019
4. 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?
6. 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
32. 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
33. 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
34. 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]
35. 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
36. MULTIPLE DEVELOPERS WORKING ON SAME BRANCH
EXPERIMENT: AUTO-MERGE
‣ You are working on same branch
‣ Someone pushed some changes after your last pull
37. 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
38. GET THE UPDATES AND CHECK PROGRESS
BRANCHING FOR ISOLATED FEATURES
39. 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”
40. 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