SlideShare a Scribd company logo
Git usage
(Basics and workflow)
- YEASIN ABEDIN SIAM (NAUTISK TEAM)
- HASAN IBRAHIM SHUVO (NAUTISK TEAM)
What is Git?
 Version Controlling System
 Distributed Mechanism
 Thus if any server dies, and these systems were collaborating via it, any of
the client repositories can be copied back up to the server to restore it
Centralized vs Decentralized VCS
 Centralized version control systems are based on the idea that there is a
single ā€œcentralā€ copy of your project somewhere (probably on a server),
and programmers will ā€œcommitā€ their changes to this central copy.
 ā€œCommittingā€ a change simply means recording the change in the central
system. Other programmers can then see this change. They can also pull
down the change, and the version control tool will automatically update the
contents of any files that were changed.
 Example CVS, Subversion (or SVN) and Perforce
Centralized vs Decentralized…
Git tools
 Install Git
 Install Git Client (TortoiseGit, SourceTree, Git for VisualStudio)
 Some client includes git as well (example Github Desktop, SourceTree)
Working with Git
 To start working with Git, you just need to run the "git init" command. It
turns the current directory into the Git working directory and creates the
repository in the .git (hidden) directory it creates there.
 The ā€œgit addā€ command adds untracked file in the staging area.
 The ā€œgit commitā€ command commits the changes in the file.
 The ā€œgit checkoutā€ checks out a branch from repository into the working
directory
Git Workflow
File tracking
Git sees every file in your working copy as one of three things:
ļ‚§ tracked - a file which has been previously staged or committed;
ļ‚§ untracked - a file which has not been staged or committed; or
ļ‚§ ignored - a file which Git has been explicitly told to ignore.
.gitignore file
 Dependency caches, such as the contents of /node_modules or /packages
 Compiled code, such as .o, .pyc, and .class files
 Build output directories, such as /bin, /out, or /target
 Files generated at runtime, such as .log, .lock, or .tmp
 personal IDE configuration files, such as .idea/workspace.xml
 Existing ignore patterns : https://github.com/github/gitignore
Git Ignore Patterns
Git vs SVN
 Git is distributed system whereas SVN is centralized.
 Git is faster than SVN.
 Git repositories are much smaller than SVN.
 Git are simpler and lees resource heavy than SVN’s.
 Git tracks content unlike SVN’s file tracking
 Merging is simpler in Git; because you don’t need to remember the last
revision you merged from which is required in SVN.
 Git is perfectly suited for Open Source projects: Just Fork it, commit your
changes to your own Fork, and then ask the original project maintainer to
pull your changes.
Git vs Mercurial
 Mercurial is much simpler than Git.
 Git has better history control than Mercurial.
 Branching is more powerful in Git.
 Git has staging area, mercurial doesn’t have
 Mercurial has better GUI support
GitFlow
What is GitFlow?
 GitFlow is a branching model for Git.
 Created by Vincent Driessen.
 Well suited to collaboration and scaling the development team.
Motivations
 Parallel Development
 Collaboration
 Release staging area
 Support for emergency fixes
Branches
 Feature branch
 Develop branch
 Release branch
 Hotfix branch
 Master branch
Feature Branch
 Feature branches are started off of the develop branch.
 Finished features and fixes are merged back into the develop
branch when they’re ready for release
Feature Branch
Release
 When it is time to make a release, a release branch is created off
of develop branch
 The code in the release branch is deployed onto a suitable test
environment, tested, and any problems are fixed directly in the release
branch. This deploy -> test -> fix -> redeploy -> retest cycle continues
until you’re happy that the release is good enough to release to customers.
 When the release is finished, the release branch is merged
into master and into develop too, to make sure that any changes made in
the release branch aren’t accidentally lost by new development.
Release
Master Branch
 The master branch tracks released code only.
 The only commits to master are merges from release
branches and hotfix branches.
Hotfix Branch
Hotfix branches are used to create emergency fixes.
Hotfix Branch
Git Usage Scenario
Git Stash
 We have changes which are temporary
 But, we don’t want to commit this
 Neither, we want to loose it
 Stash saves state of current working changes
 But Git does not track them for commit
 We can compare working copy with stash
 Stash can be merged to master
Git Rebase
Git Rebase…
Git Rebase…
Git Rebase…
Git Rebase…
Git Rebase…
Use case : Remove faulty push
 Some faulty commits has been pushed to remote
 We want to revert back
 How can we do this?
Solution
 Reset master to a commit which is Stable (Hard Reset - local)
 Now, you are in master and do a FORCE PUSH.
 git push -f origin master:master # force push
Cherry Pick
 You're working in a feature branch
 Isn't quite ready for a full merge.
 But you do have a few commits in there that you want to push to master
 We can do this by Cherry Pick
 Allow us to merge specific number of commits
Refrences
 https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
 https://www.ibm.com/developerworks/library/d-learn-workings-
git/index.html
 https://www.atlassian.com/git/tutorials/gitignore
 https://www.atlassian.com/git/tutorials/gitignore#git-ignore-patterns
 https://datasift.github.io/gitflow/IntroducingGitFlow.html
 http://nvie.com/posts/a-successful-git-branching-model/

More Related Content

What's hot (20)

PDF
Subversion to Git Migration
Manish Chakravarty
Ā 
PDF
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
Ā 
PPTX
Intro to git and git hub
Venkat Malladi
Ā 
PPTX
Git basics to advance with diagrams
Dilum Navanjana
Ā 
PPTX
Git and GitFlow branching model
Pavlo Hodysh
Ā 
ODP
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Parag Gajbhiye
Ā 
PPTX
Git branching strategies
jstack
Ā 
PPSX
Git the fast version control system
Jeroen Rosenberg
Ā 
PPTX
Webinar : SVN to GIT Migration
Newt Global Consulting LLC
Ā 
PDF
A Git Workflow Model or Branching Strategy
Vivek Parihar
Ā 
PPTX
Git flow
Suraj Aair
Ā 
PDF
Git and git hub
Sebastiaan Deckers
Ā 
PPTX
Git Pull Requests
Callon Campbell
Ā 
PPTX
Git - Simplified For Testers
upadhyay_25
Ā 
PPTX
Git & Github
Aman Lalpuria
Ā 
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
Ā 
PPTX
Bitbucket git-bamboo-jira
lenamattt
Ā 
PDF
Git tutorial
mobaires
Ā 
PPTX
Git introduction
Ivan Adhi Prasetya
Ā 
PDF
Git and GitHub workflows
Arthur Shvetsov
Ā 
Subversion to Git Migration
Manish Chakravarty
Ā 
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
Ā 
Intro to git and git hub
Venkat Malladi
Ā 
Git basics to advance with diagrams
Dilum Navanjana
Ā 
Git and GitFlow branching model
Pavlo Hodysh
Ā 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Parag Gajbhiye
Ā 
Git branching strategies
jstack
Ā 
Git the fast version control system
Jeroen Rosenberg
Ā 
Webinar : SVN to GIT Migration
Newt Global Consulting LLC
Ā 
A Git Workflow Model or Branching Strategy
Vivek Parihar
Ā 
Git flow
Suraj Aair
Ā 
Git and git hub
Sebastiaan Deckers
Ā 
Git Pull Requests
Callon Campbell
Ā 
Git - Simplified For Testers
upadhyay_25
Ā 
Git & Github
Aman Lalpuria
Ā 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
Ā 
Bitbucket git-bamboo-jira
lenamattt
Ā 
Git tutorial
mobaires
Ā 
Git introduction
Ivan Adhi Prasetya
Ā 
Git and GitHub workflows
Arthur Shvetsov
Ā 

Similar to Git usage (Basics and workflow) (20)

PPTX
01 - Git vs SVN
Edward Goikhman
Ā 
PPTX
GIT In Detail
Haitham Raik
Ā 
PDF
Git basics for beginners
PravallikaTammisetty
Ā 
PPTX
Lets git to it
Yoram Michaeli
Ā 
PPTX
GIT.pptx
Soumen Debgupta
Ā 
PDF
Git with the flow
Dana White
Ā 
PPTX
github ppt git ppt on git hub to know ab
infoinnext
Ā 
PDF
Introducing Git and git flow
Sebin Benjamin
Ā 
PPTX
Getting Git...before it gets you
Jeremy Brown
Ā 
PPTX
An introduction to Git and GitFlow
Mark Everard
Ā 
PDF
GIT_training_SoftServeBulgaria2016
Peter Denev
Ā 
PPTX
Git more done
Kwen Peterson
Ā 
PPTX
git Technologies
Hirantha Pradeep
Ā 
PPTX
Git Basics for Software Version Management
ishanmittal49
Ā 
PPTX
Source Control Using Git
Chris Mylonas
Ā 
PPTX
Git - Version Control System
Namig Hajiyev
Ā 
PPTX
Git
Okba Mahdjoub
Ā 
PPTX
Presentation on Repository Control System
Md. Mujahid Islam
Ā 
PPTX
git.ppt.pptx power point presentation got Google internet
rani marri
Ā 
PPTX
Git walkthrough
Bimal Jain
Ā 
01 - Git vs SVN
Edward Goikhman
Ā 
GIT In Detail
Haitham Raik
Ā 
Git basics for beginners
PravallikaTammisetty
Ā 
Lets git to it
Yoram Michaeli
Ā 
GIT.pptx
Soumen Debgupta
Ā 
Git with the flow
Dana White
Ā 
github ppt git ppt on git hub to know ab
infoinnext
Ā 
Introducing Git and git flow
Sebin Benjamin
Ā 
Getting Git...before it gets you
Jeremy Brown
Ā 
An introduction to Git and GitFlow
Mark Everard
Ā 
GIT_training_SoftServeBulgaria2016
Peter Denev
Ā 
Git more done
Kwen Peterson
Ā 
git Technologies
Hirantha Pradeep
Ā 
Git Basics for Software Version Management
ishanmittal49
Ā 
Source Control Using Git
Chris Mylonas
Ā 
Git - Version Control System
Namig Hajiyev
Ā 
Presentation on Repository Control System
Md. Mujahid Islam
Ā 
git.ppt.pptx power point presentation got Google internet
rani marri
Ā 
Git walkthrough
Bimal Jain
Ā 
Ad

Recently uploaded (20)

PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
Ā 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
Ā 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
Ā 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
Ā 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
Ā 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
Ā 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
Ā 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
Ā 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
Ā 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
Ā 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
Ā 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
Ā 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
Ā 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
Ā 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
Ā 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
Ā 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
Ā 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
Ā 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
Ā 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
Ā 
Smart Trailers 2025 Update with History and Overview
Paul Menig
Ā 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
Ā 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
Ā 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
Ā 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
Ā 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
Ā 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
Ā 
Blockchain Transactions Explained For Everyone
CIFDAQ
Ā 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
Ā 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
Ā 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
Ā 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
Ā 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
Ā 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
Ā 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
Ā 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
Ā 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
Ā 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
Ā 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
Ā 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
Ā 
Ad

Git usage (Basics and workflow)

  • 1. Git usage (Basics and workflow) - YEASIN ABEDIN SIAM (NAUTISK TEAM) - HASAN IBRAHIM SHUVO (NAUTISK TEAM)
  • 2. What is Git?  Version Controlling System  Distributed Mechanism  Thus if any server dies, and these systems were collaborating via it, any of the client repositories can be copied back up to the server to restore it
  • 3. Centralized vs Decentralized VCS  Centralized version control systems are based on the idea that there is a single ā€œcentralā€ copy of your project somewhere (probably on a server), and programmers will ā€œcommitā€ their changes to this central copy.  ā€œCommittingā€ a change simply means recording the change in the central system. Other programmers can then see this change. They can also pull down the change, and the version control tool will automatically update the contents of any files that were changed.  Example CVS, Subversion (or SVN) and Perforce
  • 5. Git tools  Install Git  Install Git Client (TortoiseGit, SourceTree, Git for VisualStudio)  Some client includes git as well (example Github Desktop, SourceTree)
  • 6. Working with Git  To start working with Git, you just need to run the "git init" command. It turns the current directory into the Git working directory and creates the repository in the .git (hidden) directory it creates there.  The ā€œgit addā€ command adds untracked file in the staging area.  The ā€œgit commitā€ command commits the changes in the file.  The ā€œgit checkoutā€ checks out a branch from repository into the working directory
  • 8. File tracking Git sees every file in your working copy as one of three things: ļ‚§ tracked - a file which has been previously staged or committed; ļ‚§ untracked - a file which has not been staged or committed; or ļ‚§ ignored - a file which Git has been explicitly told to ignore.
  • 9. .gitignore file  Dependency caches, such as the contents of /node_modules or /packages  Compiled code, such as .o, .pyc, and .class files  Build output directories, such as /bin, /out, or /target  Files generated at runtime, such as .log, .lock, or .tmp  personal IDE configuration files, such as .idea/workspace.xml  Existing ignore patterns : https://github.com/github/gitignore
  • 11. Git vs SVN  Git is distributed system whereas SVN is centralized.  Git is faster than SVN.  Git repositories are much smaller than SVN.  Git are simpler and lees resource heavy than SVN’s.  Git tracks content unlike SVN’s file tracking  Merging is simpler in Git; because you don’t need to remember the last revision you merged from which is required in SVN.  Git is perfectly suited for Open Source projects: Just Fork it, commit your changes to your own Fork, and then ask the original project maintainer to pull your changes.
  • 12. Git vs Mercurial  Mercurial is much simpler than Git.  Git has better history control than Mercurial.  Branching is more powerful in Git.  Git has staging area, mercurial doesn’t have  Mercurial has better GUI support
  • 14. What is GitFlow?  GitFlow is a branching model for Git.  Created by Vincent Driessen.  Well suited to collaboration and scaling the development team.
  • 15. Motivations  Parallel Development  Collaboration  Release staging area  Support for emergency fixes
  • 16. Branches  Feature branch  Develop branch  Release branch  Hotfix branch  Master branch
  • 17. Feature Branch  Feature branches are started off of the develop branch.  Finished features and fixes are merged back into the develop branch when they’re ready for release
  • 19. Release  When it is time to make a release, a release branch is created off of develop branch  The code in the release branch is deployed onto a suitable test environment, tested, and any problems are fixed directly in the release branch. This deploy -> test -> fix -> redeploy -> retest cycle continues until you’re happy that the release is good enough to release to customers.  When the release is finished, the release branch is merged into master and into develop too, to make sure that any changes made in the release branch aren’t accidentally lost by new development.
  • 21. Master Branch  The master branch tracks released code only.  The only commits to master are merges from release branches and hotfix branches.
  • 22. Hotfix Branch Hotfix branches are used to create emergency fixes.
  • 25. Git Stash  We have changes which are temporary  But, we don’t want to commit this  Neither, we want to loose it  Stash saves state of current working changes  But Git does not track them for commit  We can compare working copy with stash  Stash can be merged to master
  • 32. Use case : Remove faulty push  Some faulty commits has been pushed to remote  We want to revert back  How can we do this?
  • 33. Solution  Reset master to a commit which is Stable (Hard Reset - local)  Now, you are in master and do a FORCE PUSH.  git push -f origin master:master # force push
  • 34. Cherry Pick  You're working in a feature branch  Isn't quite ready for a full merge.  But you do have a few commits in there that you want to push to master  We can do this by Cherry Pick  Allow us to merge specific number of commits
  • 35. Refrences  https://git-scm.com/book/en/v2/Getting-Started-Git-Basics  https://www.ibm.com/developerworks/library/d-learn-workings- git/index.html  https://www.atlassian.com/git/tutorials/gitignore  https://www.atlassian.com/git/tutorials/gitignore#git-ignore-patterns  https://datasift.github.io/gitflow/IntroducingGitFlow.html  http://nvie.com/posts/a-successful-git-branching-model/