SlideShare a Scribd company logo
1 of 27
Download to read offline
Git Workflow
Gary
2014/11/10
Outline
• What is Git?
• Git Workflow and Git Commands
• Branching and merging
• Git Implement
What is Git?
• Git is a distributed revision control and source code management
(SCM) system with an emphasis on speed, data integrity, and support
for distributed, nonlinear workflows.
• Git was initially designed and developed by Linus Torvalds for Linux
kernel development in 2005, and has since become the most widely
adopted version control system for software development.
Git Design Goals
• Speed
• Simple design
• Strong support for thousands of parallel branches
• Fully distributed
• full local repository
• offline commits
• full size repository
• Able to handle large projects like Linux kernel effectively
• Ensure integrity
Distributed Development
• Every Git working directory contains the complete repository, history
and full revision tracking capabilities
• You’re not dependent on a central server and you don’t have to be
online
• Git is extremely fast - much faster than SVN, CVS and other systems
• Revisions (commits) you make to your local repository are available to
you only
Distributed Development
• The next time you connect to the internet, push your changes to a
remote repository to share them and back them up
• The local nature of Git makes it effortless to create branches to isolate
your work
• The local nature of Git makes it possible to coalesce a series of
changes (local commits) into a single commit on the remote branch
Tracking Changes (most VCS)
Tracking Changes (the Git way)
File Status Lifecycle
Understanding of Workflow
• Obtain a repository
• git init or git clone
• Make some changes
• Stage your changes
• git add
• Commit changes to the local repository
• git commit –m “My message”
• Push changes to remote
• git push remotename remotebranch
Git Commands
• Setup and Config
• git config
• Get and set repository or global options
• git help
• Display help information about Git
• Getting and Creating Projects
• git init
• Create an empty Git repository or reinitialize an existing one
• git clone
• Clone a repository into a new directory
Git Commands
• Basic Snapshotting
• git add
• Add file contents to the index
• git status
• Show the working tree status
• git commit
• Record changes to the repository
Git Commands
• Branching and Merging
• git branch
• List, create, or delete branches
• git checkout
• Checkout a branch or paths to the working tree
• git merge
• Join two or more development histories together
Git Commands
• Sharing and Updating Projects
• git fetch
• Download objects and refs from another repository
• git pull
• Fetch from and integrate with another repository or a local branch
• git push
• Updating remote refs along associated objects
Branching and Merging
• Example
1. Develop a website
2. To implement a new function, create a new branch
3. Work on this new branch
C0 C1 C2
master
Branching and Merging
• Example
1. Develop a website
2. To implement a new function, create a new branch
3. Work on this new branch
C0 C1 C2
master
iss53
git checkout –b iss53
Or
git branch iss53
git checkout iss53
Branching and Merging
• Example
1. Develop a website
2. To implement a new function, create a new branch
3. Work on this new branch
C0 C1 C2
master
iss53
C3git commit –a –m ‘add a new footer’
Branching and Merging
• There is a bug on the system
1. Go to stable released version
2. Create a new branch, and debug
3. After solving the problem, merge the branch
4. Back to the new function branch
C0 C1 C2
master
iss53
C3
Branching and Merging
• There is a bug on the system
1. Go to stable released version
2. Create a new branch, and debug
3. After solving the problem, merge the branch
4. Back to the new function branch
C0 C1 C2
master
iss53
C4
git checkout –b hotfix
git commit –a –m ‘fixed the problem’
hotfix
C3
Branching and Merging
• There is a bug on the system
1. Go to stable released version
2. Create a new branch, and debug
3. After solving the problem, merge the branch
4. Back to the new function branch
C0 C1 C2
iss53
C4
git checkout master
git merge hotfix
hotfix
C3
master
Branching and Merging
• After implement the new function, merge into stable version
C0 C1 C2
iss53
C4
git branch –d hotfix
git checkout iss53
git commit –a –m ‘finish the new footer ’
C3
master
C5
Branching and Merging
• After implement the new function, merge into stable version
C0 C1 C2
iss53
C4
git checkout master
git merge iss53
C3
master
C5
C6
Git Implement
• Environment
• Windows 7 64-bit
• Git-1.8.4
• Step 1 : Setting user information
• Use git bash
git config --global user.name “custom user name"
git config --global email “custom e-mail"
Git Implement
• Step 2 : Initialize
• Use git init here
• Or use git bash and key in git init
Git Implement
• Step 3 : Add files
• In git bash, key in
• Step 4 : Version control
git add .
git add *
git commit –a
or
git commit -m “the information"
Git Implement
• Step 5 : Start Using
git add -u
Q&A Goodbye!

More Related Content

What's hot

git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucketazwildcat
 
01 git interview questions & answers
01   git interview questions & answers01   git interview questions & answers
01 git interview questions & answersDeepQuest Software
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01Gourav Varma
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - GitCarlo Bernaschina
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitLuigi De Russis
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control SystemKMS Technology
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubGDSCIIITBbsr
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratchMir Arif Hasan
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitJason Byrne
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-BryanLearningTech
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentalsRajKharvar
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03Gourav Varma
 

What's hot (20)

git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucket
 
01 git interview questions & answers
01   git interview questions & answers01   git interview questions & answers
01 git interview questions & answers
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Bitbucket and Git
Bitbucket and GitBitbucket and Git
Bitbucket and Git
 
Git 101
Git 101Git 101
Git 101
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - Git
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratch
 
Git presentation
Git presentationGit presentation
Git presentation
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 

Viewers also liked

Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013
Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013
Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013Андрей Кухаренко
 
Reunion Technique PMSIpilot - Janvier 2010
Reunion Technique PMSIpilot - Janvier 2010Reunion Technique PMSIpilot - Janvier 2010
Reunion Technique PMSIpilot - Janvier 2010PMSIpilot
 
How to become a better software company technically
How to become a better software company technicallyHow to become a better software company technically
How to become a better software company technicallyGeshan Manandhar
 
Git workflow
Git workflowGit workflow
Git workflowPMSIpilot
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlJeremy Coates
 

Viewers also liked (6)

Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013
Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013
Начало работы с Git (Visual Studio 2013, Bitbucket) - version 2013
 
Reunion Technique PMSIpilot - Janvier 2010
Reunion Technique PMSIpilot - Janvier 2010Reunion Technique PMSIpilot - Janvier 2010
Reunion Technique PMSIpilot - Janvier 2010
 
How to become a better software company technically
How to become a better software company technicallyHow to become a better software company technically
How to become a better software company technically
 
Git workflow
Git workflowGit workflow
Git workflow
 
A simplified Gitflow
A simplified GitflowA simplified Gitflow
A simplified Gitflow
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 

Similar to Git Workflow

Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
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
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to MasterC. M. Abdullah Khan
 
Git and GitHub (1).pptx
Git and GitHub (1).pptxGit and GitHub (1).pptx
Git and GitHub (1).pptxBetelAddisu
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Fundamentals of Git
Fundamentals of GitFundamentals of Git
Fundamentals of Gitcmckni3
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02Gourav Varma
 
Git for uninitiated
Git for uninitiatedGit for uninitiated
Git for uninitiatedJohn C. Chan
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptxtnscharishma
 
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
 

Similar to Git Workflow (20)

Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
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
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to Master
 
Git and GitHub (1).pptx
Git and GitHub (1).pptxGit and GitHub (1).pptx
Git and GitHub (1).pptx
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Fundamentals of Git
Fundamentals of GitFundamentals of Git
Fundamentals of Git
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Git for uninitiated
Git for uninitiatedGit for uninitiated
Git for uninitiated
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
 
Git overview
Git overviewGit overview
Git overview
 
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
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 

More from Gary Yeh

Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSPGary Yeh
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript EngineGary Yeh
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device DriverGary Yeh
 
jQuery Mobile and JavaScript
jQuery Mobile and JavaScriptjQuery Mobile and JavaScript
jQuery Mobile and JavaScriptGary Yeh
 
JQuery mobile
JQuery mobileJQuery mobile
JQuery mobileGary Yeh
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database ConnectivityGary Yeh
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvasGary Yeh
 

More from Gary Yeh (10)

Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript Engine
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device Driver
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
 
jQuery Mobile and JavaScript
jQuery Mobile and JavaScriptjQuery Mobile and JavaScript
jQuery Mobile and JavaScript
 
JQuery mobile
JQuery mobileJQuery mobile
JQuery mobile
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Git Workflow

  • 2. Outline • What is Git? • Git Workflow and Git Commands • Branching and merging • Git Implement
  • 3. What is Git? • Git is a distributed revision control and source code management (SCM) system with an emphasis on speed, data integrity, and support for distributed, nonlinear workflows. • Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005, and has since become the most widely adopted version control system for software development.
  • 4. Git Design Goals • Speed • Simple design • Strong support for thousands of parallel branches • Fully distributed • full local repository • offline commits • full size repository • Able to handle large projects like Linux kernel effectively • Ensure integrity
  • 5. Distributed Development • Every Git working directory contains the complete repository, history and full revision tracking capabilities • You’re not dependent on a central server and you don’t have to be online • Git is extremely fast - much faster than SVN, CVS and other systems • Revisions (commits) you make to your local repository are available to you only
  • 6. Distributed Development • The next time you connect to the internet, push your changes to a remote repository to share them and back them up • The local nature of Git makes it effortless to create branches to isolate your work • The local nature of Git makes it possible to coalesce a series of changes (local commits) into a single commit on the remote branch
  • 10. Understanding of Workflow • Obtain a repository • git init or git clone • Make some changes • Stage your changes • git add • Commit changes to the local repository • git commit –m “My message” • Push changes to remote • git push remotename remotebranch
  • 11. Git Commands • Setup and Config • git config • Get and set repository or global options • git help • Display help information about Git • Getting and Creating Projects • git init • Create an empty Git repository or reinitialize an existing one • git clone • Clone a repository into a new directory
  • 12. Git Commands • Basic Snapshotting • git add • Add file contents to the index • git status • Show the working tree status • git commit • Record changes to the repository
  • 13. Git Commands • Branching and Merging • git branch • List, create, or delete branches • git checkout • Checkout a branch or paths to the working tree • git merge • Join two or more development histories together
  • 14. Git Commands • Sharing and Updating Projects • git fetch • Download objects and refs from another repository • git pull • Fetch from and integrate with another repository or a local branch • git push • Updating remote refs along associated objects
  • 15. Branching and Merging • Example 1. Develop a website 2. To implement a new function, create a new branch 3. Work on this new branch C0 C1 C2 master
  • 16. Branching and Merging • Example 1. Develop a website 2. To implement a new function, create a new branch 3. Work on this new branch C0 C1 C2 master iss53 git checkout –b iss53 Or git branch iss53 git checkout iss53
  • 17. Branching and Merging • Example 1. Develop a website 2. To implement a new function, create a new branch 3. Work on this new branch C0 C1 C2 master iss53 C3git commit –a –m ‘add a new footer’
  • 18. Branching and Merging • There is a bug on the system 1. Go to stable released version 2. Create a new branch, and debug 3. After solving the problem, merge the branch 4. Back to the new function branch C0 C1 C2 master iss53 C3
  • 19. Branching and Merging • There is a bug on the system 1. Go to stable released version 2. Create a new branch, and debug 3. After solving the problem, merge the branch 4. Back to the new function branch C0 C1 C2 master iss53 C4 git checkout –b hotfix git commit –a –m ‘fixed the problem’ hotfix C3
  • 20. Branching and Merging • There is a bug on the system 1. Go to stable released version 2. Create a new branch, and debug 3. After solving the problem, merge the branch 4. Back to the new function branch C0 C1 C2 iss53 C4 git checkout master git merge hotfix hotfix C3 master
  • 21. Branching and Merging • After implement the new function, merge into stable version C0 C1 C2 iss53 C4 git branch –d hotfix git checkout iss53 git commit –a –m ‘finish the new footer ’ C3 master C5
  • 22. Branching and Merging • After implement the new function, merge into stable version C0 C1 C2 iss53 C4 git checkout master git merge iss53 C3 master C5 C6
  • 23. Git Implement • Environment • Windows 7 64-bit • Git-1.8.4 • Step 1 : Setting user information • Use git bash git config --global user.name “custom user name" git config --global email “custom e-mail"
  • 24. Git Implement • Step 2 : Initialize • Use git init here • Or use git bash and key in git init
  • 25. Git Implement • Step 3 : Add files • In git bash, key in • Step 4 : Version control git add . git add * git commit –a or git commit -m “the information"
  • 26. Git Implement • Step 5 : Start Using git add -u