SlideShare une entreprise Scribd logo
1  sur  18
Git Basics

Md. Emran Ul Hadi
Software Engineer
  WNeeds Ltd
            What we'll cover


• Concept of Version control system
• Concept of Git
• Some basic commands
            Version control


Most used Concurrent version system(CVS) and
Subversion(SVN).

Key concepts:
 • Central source control system
 • users check code into server
 • requires connection to the server to perform commits,
    updates etc.
        
                    Git ???????

• Distributed Version Control System
•  Like sub-version but better...
• Created by Linus Torvald
            WHY Git??????

   Distributed repository
 • Self contained
 • Full history of commit
 •  You can commit/branch/merge locally
 • Read fast and offline
 •  No "latest revision": revision unique ID
                    Get Started
                Git Started           
 getting started
  • move to a directory with code you’d like to manage
    with git:
 # git init
 • you’ve now created your first git repository!

 For remote repository access:
 # git clone remote_git_repository_url
 Example:
 # git clone git@github.com:mobbazaar/api
                    Work Flow

  
                     Useful   basics commands
  
   git init           ‣ repository setup

  git add             ‣ add files to queue for next commit

  git commit          ‣ commit queued files

  git push            ‣ push commit(s) to remote repository

  git pull            ‣ fetch changes from remote repository

  git clone           ‣ clone repository into a local directory 

  .gitignore          ‣ ignore specific files by adding them here
                Continue...
git status        ‣ Show uncommited changes

git rm            ‣ Remove a file from a repository

git mv            ‣ Move a file within repository

git diff          ‣ Generate a differences between    
                  multiple commits
git log           ‣ View a log of commits
                    Git Level

    
                    Branches
                   Branching
git branch new_branch    create new branch


git branch -b feature2   create new branch and switch
                         to that branch

git commit               save some work

git checkout master      switch back

git merge feature2       work is merged in

git rebase feature2      work played on top

git branch -d feature2   delete branch
            tagging and merging
git merge branch_name   Merge changes from
                        branch_name to the current
                        branch

git tag -a name         Add a tag with a indicated
                        name

git tag -l              List tags


git push --tags         Push tags to remote
                        repository
     Handling Some critical situation

 • Changing your last commit
             #  git commit --amend     
 • Unstaging a staged File
                # git reset HEAD FILE_NAME 
• Unmodifying a modified File
              # git checkout -- FILE_NAME
          Some rules have to follow


• NEVER pull when you have uncommitted changes - commit
  your work first.
• First PULL then PUSH
• If working on a feature, use a local branch, then this
  leaves the master open for other fixes.
        
Let's
        Discuss
                 Resources

• http://gitref.org                   [For basics commands]
• http://progit.org/book/
• http://www.slideshare.net/search/slideshow?
  searchfrom=header&q=git  

Contenu connexe

Tendances

Learning git
Learning gitLearning git
Learning gitSid Anand
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
GIT presentation
GIT presentationGIT presentation
GIT presentationNaim Latifi
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control SystemKMS Technology
 
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 GitE Carter
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow IntroductionDavid Paluy
 

Tendances (20)

Git training v10
Git training v10Git training v10
Git training v10
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Learning git
Learning gitLearning git
Learning git
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git basics
Git basicsGit basics
Git basics
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Git
GitGit
Git
 
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 Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 

Similaire à Git basic

Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
 
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started PresentationNap Ramirez
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.comdropsolid
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthroughBimal Jain
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Source control management
Source control managementSource control management
Source control managementOwen Winkler
 
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
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 

Similaire à Git basic (20)

Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started Presentation
 
Session git
Session gitSession git
Session git
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Source control management
Source control managementSource control management
Source control management
 
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
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git
GitGit
Git
 
git Technologies
git Technologiesgit Technologies
git Technologies
 

Dernier

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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 educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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)wesley chun
 
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 DevelopmentsTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 BusinessPixlogix Infotech
 

Dernier (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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)
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 

Git basic

  • 1. Git Basics Md. Emran Ul Hadi Software Engineer WNeeds Ltd
  • 2.             What we'll cover • Concept of Version control system • Concept of Git • Some basic commands
  • 3.             Version control Most used Concurrent version system(CVS) and Subversion(SVN). Key concepts: • Central source control system • users check code into server • requires connection to the server to perform commits, updates etc.         
  • 4.                     Git ??????? • Distributed Version Control System •  Like sub-version but better... • Created by Linus Torvald
  • 5.             WHY Git??????    Distributed repository • Self contained • Full history of commit •  You can commit/branch/merge locally • Read fast and offline •  No "latest revision": revision unique ID
  • 6.                     Get Started
  • 7.                 Git Started            getting started • move to a directory with code you’d like to manage with git: # git init • you’ve now created your first git repository! For remote repository access: # git clone remote_git_repository_url Example: # git clone git@github.com:mobbazaar/api
  • 8.                     Work Flow   
  • 9.                      Useful basics commands      git init ‣ repository setup   git add ‣ add files to queue for next commit   git commit ‣ commit queued files   git push ‣ push commit(s) to remote repository   git pull ‣ fetch changes from remote repository   git clone ‣ clone repository into a local directory    .gitignore ‣ ignore specific files by adding them here
  • 10.                 Continue... git status ‣ Show uncommited changes git rm  ‣ Remove a file from a repository git mv ‣ Move a file within repository git diff ‣ Generate a differences between     multiple commits git log ‣ View a log of commits
  • 11.                     Git Level     
  • 12.                     Branches
  • 13.                    Branching git branch new_branch  create new branch git branch -b feature2 create new branch and switch to that branch git commit save some work git checkout master  switch back git merge feature2 work is merged in git rebase feature2 work played on top git branch -d feature2 delete branch
  • 14.             tagging and merging git merge branch_name Merge changes from branch_name to the current branch git tag -a name Add a tag with a indicated name git tag -l List tags git push --tags Push tags to remote repository
  • 15.      Handling Some critical situation • Changing your last commit              #  git commit --amend      • Unstaging a staged File                 # git reset HEAD FILE_NAME  • Unmodifying a modified File               # git checkout -- FILE_NAME
  • 16.           Some rules have to follow • NEVER pull when you have uncommitted changes - commit your work first. • First PULL then PUSH • If working on a feature, use a local branch, then this leaves the master open for other fixes.         
  • 17. Let's Discuss
  • 18.                  Resources • http://gitref.org                   [For basics commands] • http://progit.org/book/ • http://www.slideshare.net/search/slideshow? searchfrom=header&q=git