SlideShare una empresa de Scribd logo
1 de 41
Let’s GIT to it!
Introduction to git & branching models
Yoram Michaeli
<yorammi@tikalk.com>
FullStack Developers Israel
14.5.2014
Tikal, Tel-Aviv
Hosted by:
Before you GIT it...
What is GIT?
What is GIT?
● GIT is a distributed revision controlled
source code management system (DVCS)
● GIT were created, designed and developed
by Linus Torvalds (the creator of Linux) for
Linux kernel development
(See Linus Torvalds in YouTube)
● Official GIT site: http://git-scm.com
Why use GIT?
Why use GIT?There are many other SCM/SVCS systems out there...
● GIT is fast
● GIT has no need for network connection -
for most operations
● GIT is a great merge and branching tool
● GIT is a modern tool
● GIT have a very large install-base
● GIT encourage developers to commit, which
results with less data lose
GIT is distributed
● There is no single server – each endpoint
contains all the information.
● Usually there is one endpoint that is considered as
the central one but this is not a must.
● The common flow:
o You clone the central repository and/or sync
with its content
o You work offline on your private repository
o You push your local changes into the central
repository
GIT is distributed
GIT is fast
● For most operations you need no network
connection
● Network operations are done very fast using
modern and validated transfer actions
● GIT uses snapshots of the whole repository
instead of the files-and-delta technology
● GIT uses pointers
● GIT is optimized for merge...
GIT is optimized for merge
● GIT is designed for fast and efficient merge
● GIT supports:
o Local merge
o 2 repositories/endpoints merge
o Simultaneously work on the same resource
o Merge is usually done locally before
pushing it to the remote repository so it is
very easy to abort it or revert to the previous
status
Things you must
consider about GIT?
Things you must consider
about GIT
● GIT is not CVS or SVN or any of
those tools
● GIT requires much to learn about it
● GIT command line interface (CLI) is
the most recommended client for it
GIT concepts overview
SVN vs. GIT
GIT commit representation
GIT repositoryThe multiple commit concept
● Each commit store a pointer to the former
(checksum) commit
● The first commit has a null pointer
GIT branchesBasic terms
● branch – a pointer to some commit
● master – the “default” branch
● HEAD – the current branch of the local/remote repository
● origin – the remote repository (usually – the one you have
cloned from)
● origin/master – the master branch (pointer) of the origin
repository
GIT local work
GIT directory
...is where Git stores the metadata and object database for your project
Working directory
...is a single checkout of one version of the project on your disk.
Staging area (Index)
...is a simple snapshot file in your Git directory, that stores information about what will go
into your next commit.
Why staging?
● Gives you the ability to control the content of your next commit
● You can reset changes
● You can 'stash' all changes and work on a new task in the same location
● Once you’re done with your code – for committing - you can:
o Review the differences between working directory and staging
o Review the differences between staging and HEAD
A GIT file life-cycle
GIT basic flow and
operations
GIT basic flow
The common flow
● You clone the central repository and sync with its content:
o git clone <remote repository URL> - cloning the
repository
o git pull origin master - sync with remote repository
● You work offline on your private repository
o git add --all - staging all new and/or removed files
o git commit -m “<comment>” - commit changes
● You push your local changes into the central repository
o git push origin master
GIT common actions & flow
Other GIT common commands
● git clone – clone a repository into a new copy
● git status – show the status of your local repository
● git log – show commit logs
● git diff - show the differences between anything: states, branches
and more
● git branch – perform branch-related actions such as create
branch, list branches and more
● git checkout – switch to work on a certain snapshot (branch, hash,
tag)
● git merge – merge into current working snapshot
● git cherrypick – merge picked commits from branch to branch
Let’s GIT started
● Install GIT (usually from http://git-scm.com)
● Initial GIT global settings
● git config --global user.name “Bill Gates”
● git config --global user.email bill.gates@microsoft.com
● GIT repository initiate:
● mkdir microsoft
● cd microsoft
● git init
or
● GIT clone:
● git clone git@microsoft:acquired-companies/someTool.git
GIT environments
GIT hosting tools and
services
GIT cloud-based hosting services
https://git.wiki.kernel.org/index.php/GitHosting
GIT on-premise hosting tools
http://en.wikipedia.org/wiki/Comparison_of_free_software_hosting_facilities
Detailed guideline for choosing GIT
host service
http://www.slideshare.net/YoramMichaeli/git-hostingservice
GIT client tools
GIT GUI client tools
GIT workflows
(branching models)
Based on Atlassian's 'GIT workflows' excellent introduction!
Centralized Workflow
If your developers are already
comfortable with Subversion, the
Centralized Workflow lets you
experience the benefits of Git
without having to adapt to an
entirely new process. It also
serves as a friendly transition
into more Git-oriented
workflows.
See more...
Feature Branch Workflow
The Feature Branch Workflow
builds on the Centralized
Workflow by encapsulating new
features into dedicated
branches. This enables the use
of pull requests as a means to
discuss changes before they’re
integrated into the official
project.
See more...
Gitflow Workflow
The Gitflow Workflow
streamlines the release cycle
by using isolated branches
for feature development,
release preparation, and
maintenance. Its strict
branching model also lends
some much needed structure
to larger projects.
See more...
GitHub Flow
what is GitHub Flow?
● Anything in the master branch is deployable
● To work on something new, create a descriptively named
branch off of master (ie:new-oauth2-scopes)
● Commit to that branch locally and regularly push your
work to the same named branch on the server
● When you need feedback or help, or you think the branch
is ready for merging, open a pull request
● After someone else has reviewed and signed off on the
feature, you can merge it into master
● Once it is merged and pushed to ‘master’, you can and
should deploy immediately
See more...
Forking Workflow
The Forking Workflow is a
distributed workflow that takes
full advantage of Git’s branching
and cloning capabilities. It
provides a safe, reliable way to
manage large teams of
developers and to accept
commits from untrusted
contributors.
See more...
Pull requests
Pull request (sometimes called
merge request) is a feature that
makes it easier for developers to
collaborate using the hosting
service. It provides a user-
friendly web interface for
discussing proposed changes
before integrating them into the
official project.
See more...
GIT more
Other GIT great starting points
Yoram Michaeli
Email: yorammi@tikalk.com
Tel: +972-52-5766838
Thank You

Más contenido relacionado

La actualidad más candente

Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
Vinoth Kannan
 

La actualidad más candente (20)

From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
 
Git - a powerful version control tool
Git - a powerful version control toolGit - a powerful version control tool
Git - a powerful version control tool
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
What is Git | What is GitHub | Git Tutorial | GitHub Tutorial | Devops Tutori...
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamental
 
Git theory
Git   theoryGit   theory
Git theory
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git
GitGit
Git
 
Git basic
Git basicGit basic
Git basic
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 

Destacado

Drupal 7 Tutorial: Features Module
Drupal 7 Tutorial: Features ModuleDrupal 7 Tutorial: Features Module
Drupal 7 Tutorial: Features Module
Acquia
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션
Dabi Ahn
 

Destacado (19)

Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
 
Git & SourceTree
Git & SourceTreeGit & SourceTree
Git & SourceTree
 
Choosing Git hosting service
Choosing Git hosting serviceChoosing Git hosting service
Choosing Git hosting service
 
Hello DevOps World
Hello DevOps WorldHello DevOps World
Hello DevOps World
 
Getting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS UsersGetting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS Users
 
Why we ditched TFS and embraced Git, Github, TeamCity and Myget
Why we ditched TFS and embraced Git, Github, TeamCity and MygetWhy we ditched TFS and embraced Git, Github, TeamCity and Myget
Why we ditched TFS and embraced Git, Github, TeamCity and Myget
 
Li liq liqui liquibase
Li liq liqui liquibaseLi liq liqui liquibase
Li liq liqui liquibase
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Drupal 7 Tutorial: Features Module
Drupal 7 Tutorial: Features ModuleDrupal 7 Tutorial: Features Module
Drupal 7 Tutorial: Features Module
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git 입문자를 위한 가이드
Git 입문자를 위한 가이드Git 입문자를 위한 가이드
Git 입문자를 위한 가이드
 
Github 사용법
Github 사용법Github 사용법
Github 사용법
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드
 
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and Git
 

Similar a Lets git to it

Similar a Lets git to it (20)

Git: Git'ing the Basic
Git: Git'ing the BasicGit: Git'ing the Basic
Git: Git'ing the Basic
 
Git presentation
Git presentationGit presentation
Git presentation
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Intro to Git
Intro to GitIntro to Git
Intro to Git
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Git tips
Git tipsGit tips
Git tips
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
Gn unify git
Gn unify gitGn unify git
Gn unify git
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for Beginners
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git workshop
Git workshopGit workshop
Git workshop
 
Git
GitGit
Git
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 
Git
GitGit
Git
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 

Más de Yoram Michaeli

Más de Yoram Michaeli (9)

Jenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshopJenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshop
 
Issue-in-the-middle-here
Issue-in-the-middle-hereIssue-in-the-middle-here
Issue-in-the-middle-here
 
Continuous integration introduction
Continuous integration introductionContinuous integration introduction
Continuous integration introduction
 
The Jenkins Pipeline Force Awakens - Jenkins User Conference Tel-Aviv 2018
The Jenkins Pipeline Force Awakens - Jenkins User Conference Tel-Aviv 2018The Jenkins Pipeline Force Awakens - Jenkins User Conference Tel-Aviv 2018
The Jenkins Pipeline Force Awakens - Jenkins User Conference Tel-Aviv 2018
 
הרכב והעתיד The Car and the future
הרכב והעתיד The Car and the futureהרכב והעתיד The Car and the future
הרכב והעתיד The Car and the future
 
The Jenkins pipeline force awakens
The Jenkins pipeline force awakensThe Jenkins pipeline force awakens
The Jenkins pipeline force awakens
 
The Jenkins Force Awaken Again @ JAM #6 meetup
 The Jenkins Force Awaken Again @ JAM #6 meetup The Jenkins Force Awaken Again @ JAM #6 meetup
The Jenkins Force Awaken Again @ JAM #6 meetup
 
Source-it Version-contol & GIT - floating-lesson
Source-it Version-contol & GIT - floating-lessonSource-it Version-contol & GIT - floating-lesson
Source-it Version-contol & GIT - floating-lesson
 
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Lets git to it

  • 1. Let’s GIT to it! Introduction to git & branching models Yoram Michaeli <yorammi@tikalk.com> FullStack Developers Israel 14.5.2014 Tikal, Tel-Aviv Hosted by:
  • 4. What is GIT? ● GIT is a distributed revision controlled source code management system (DVCS) ● GIT were created, designed and developed by Linus Torvalds (the creator of Linux) for Linux kernel development (See Linus Torvalds in YouTube) ● Official GIT site: http://git-scm.com
  • 6. Why use GIT?There are many other SCM/SVCS systems out there... ● GIT is fast ● GIT has no need for network connection - for most operations ● GIT is a great merge and branching tool ● GIT is a modern tool ● GIT have a very large install-base ● GIT encourage developers to commit, which results with less data lose
  • 7. GIT is distributed ● There is no single server – each endpoint contains all the information. ● Usually there is one endpoint that is considered as the central one but this is not a must. ● The common flow: o You clone the central repository and/or sync with its content o You work offline on your private repository o You push your local changes into the central repository
  • 9. GIT is fast ● For most operations you need no network connection ● Network operations are done very fast using modern and validated transfer actions ● GIT uses snapshots of the whole repository instead of the files-and-delta technology ● GIT uses pointers ● GIT is optimized for merge...
  • 10. GIT is optimized for merge ● GIT is designed for fast and efficient merge ● GIT supports: o Local merge o 2 repositories/endpoints merge o Simultaneously work on the same resource o Merge is usually done locally before pushing it to the remote repository so it is very easy to abort it or revert to the previous status
  • 12. Things you must consider about GIT ● GIT is not CVS or SVN or any of those tools ● GIT requires much to learn about it ● GIT command line interface (CLI) is the most recommended client for it
  • 16. GIT repositoryThe multiple commit concept ● Each commit store a pointer to the former (checksum) commit ● The first commit has a null pointer
  • 17. GIT branchesBasic terms ● branch – a pointer to some commit ● master – the “default” branch ● HEAD – the current branch of the local/remote repository ● origin – the remote repository (usually – the one you have cloned from) ● origin/master – the master branch (pointer) of the origin repository
  • 18. GIT local work GIT directory ...is where Git stores the metadata and object database for your project Working directory ...is a single checkout of one version of the project on your disk. Staging area (Index) ...is a simple snapshot file in your Git directory, that stores information about what will go into your next commit. Why staging? ● Gives you the ability to control the content of your next commit ● You can reset changes ● You can 'stash' all changes and work on a new task in the same location ● Once you’re done with your code – for committing - you can: o Review the differences between working directory and staging o Review the differences between staging and HEAD
  • 19. A GIT file life-cycle
  • 20. GIT basic flow and operations
  • 21. GIT basic flow The common flow ● You clone the central repository and sync with its content: o git clone <remote repository URL> - cloning the repository o git pull origin master - sync with remote repository ● You work offline on your private repository o git add --all - staging all new and/or removed files o git commit -m “<comment>” - commit changes ● You push your local changes into the central repository o git push origin master
  • 23. Other GIT common commands ● git clone – clone a repository into a new copy ● git status – show the status of your local repository ● git log – show commit logs ● git diff - show the differences between anything: states, branches and more ● git branch – perform branch-related actions such as create branch, list branches and more ● git checkout – switch to work on a certain snapshot (branch, hash, tag) ● git merge – merge into current working snapshot ● git cherrypick – merge picked commits from branch to branch
  • 24. Let’s GIT started ● Install GIT (usually from http://git-scm.com) ● Initial GIT global settings ● git config --global user.name “Bill Gates” ● git config --global user.email bill.gates@microsoft.com ● GIT repository initiate: ● mkdir microsoft ● cd microsoft ● git init or ● GIT clone: ● git clone git@microsoft:acquired-companies/someTool.git
  • 26. GIT hosting tools and services
  • 27. GIT cloud-based hosting services https://git.wiki.kernel.org/index.php/GitHosting
  • 28. GIT on-premise hosting tools http://en.wikipedia.org/wiki/Comparison_of_free_software_hosting_facilities
  • 29. Detailed guideline for choosing GIT host service http://www.slideshare.net/YoramMichaeli/git-hostingservice
  • 31. GIT GUI client tools
  • 32. GIT workflows (branching models) Based on Atlassian's 'GIT workflows' excellent introduction!
  • 33. Centralized Workflow If your developers are already comfortable with Subversion, the Centralized Workflow lets you experience the benefits of Git without having to adapt to an entirely new process. It also serves as a friendly transition into more Git-oriented workflows. See more...
  • 34. Feature Branch Workflow The Feature Branch Workflow builds on the Centralized Workflow by encapsulating new features into dedicated branches. This enables the use of pull requests as a means to discuss changes before they’re integrated into the official project. See more...
  • 35. Gitflow Workflow The Gitflow Workflow streamlines the release cycle by using isolated branches for feature development, release preparation, and maintenance. Its strict branching model also lends some much needed structure to larger projects. See more...
  • 36. GitHub Flow what is GitHub Flow? ● Anything in the master branch is deployable ● To work on something new, create a descriptively named branch off of master (ie:new-oauth2-scopes) ● Commit to that branch locally and regularly push your work to the same named branch on the server ● When you need feedback or help, or you think the branch is ready for merging, open a pull request ● After someone else has reviewed and signed off on the feature, you can merge it into master ● Once it is merged and pushed to ‘master’, you can and should deploy immediately See more...
  • 37. Forking Workflow The Forking Workflow is a distributed workflow that takes full advantage of Git’s branching and cloning capabilities. It provides a safe, reliable way to manage large teams of developers and to accept commits from untrusted contributors. See more...
  • 38. Pull requests Pull request (sometimes called merge request) is a feature that makes it easier for developers to collaborate using the hosting service. It provides a user- friendly web interface for discussing proposed changes before integrating them into the official project. See more...
  • 40. Other GIT great starting points