SlideShare a Scribd company logo
Before and After
                          Without version control system
                  Day 1                         Day 2                    Day 3


       Project                       Project                  Project
      Directory                     Directory                Directory




    bytes                         bytes                    bytes

    bytes                         bytes                    bytes

                                                           bytes




                           With version control system
                  Day 1                         Day 2                    Day 3


       Project                       Project                  Project
      Directory                     Directory                Directory




    bytes                         bytes                    bytes

    bytes                         bytes                    bytes

                                                           bytes
High level structure

           Centralized                                Distributed


                                                         Team
               Team                                      Lead
               Lead


                               Sr.Dev
 Sr.Dev

              Central
            Repository                       Sr.Dev                  Sr.Dev


                               Jr.Dev
 Jr.Dev



                                        Jr.Dev   Jr.Dev         Jr.Dev   Jr.Dev
          Jr.Dev      Jr.Dev
Features

 
     Distributed development.

 
     Every Developer has full copy.

 
     Most operation are local, so its fast.

 
     Strong support for non-linear development.
Create repository


                          Repository created




              MyProject
                 repo




 $ git init
Clone a repository

                                                            Remote
                                                             repo




         Local
          repo




                     Cloning complete repository to local




 $ git clone <url>
Adding files/directories (modified)

         Working                   Staging
        directory                    area




                     stage files




 $ git add <file/dir name>
Committing changes

                                       Staging             Local
 Why commit is important :               area               repo

 
     Each commit gets an SHA1

 hash key.

 
     What you put in is what

 you get out.



                                                 commits




 $ git commit -am “<commit message>”
Reset changes

         Working            Staging          Local
        directory             area            repo




                      Add – for modified
                         Or new files




                        Remove for staging
                               area




 $ git reset
 $ git reset --hard
Key points

 
     Git add :

      – To add new files.

      – To add files to staging area (shortcut: commit -a).

 
     Git reset :

      – Clear staging area.

      – Clear local changes with “--hard” option.
Status of untracked/modified files

         Working                  Staging             Local
        directory                   area               repo




                    stage files




                                            commits




 $ git status
Remote repository

                                                           Remote
                                                            repo




         Local
          repo




                                      Copy url name only




 $ git remote add <repo_name> <url>
Key points

 
     Git clone :

      – Creates a new repository by copying everything from an

        existing repository.

 
     Git remote add :

      – Creates an entry with the name of a particular url in git

        config file.
Pushing changes

    Working     Staging                 Local                  Remote
   directory     area                    repo                   repo




                                                Push changes




 $ git push <repo_name> <branch_name>
Pulling changes

    Working     Staging                 Local                  Remote
   directory     area                    repo                   repo




                                                Pull changes




 $ git pull <repo_name> <branch_name>
Fetching changes

    Working     Staging                   Local                    Remote
   directory     area                      repo                     repo




                                                   Fetch changes




                                          Re
                                            ba
                                              se




 $ git fetch <repo_name> <branch_name>
 $ git rebase <repo_name>/<branch_name>
Key points
 
     Git pull :

      – Internally it is 'git fetch' + 'git merge'.

 
     Git fetch :

      – Gets all the changes but does not apply to working copy.

 
     Git rebase :

      – Changes the commit history to match remote repo and applies

        changes to working copy.

 
     There are two ways to integrate changes 'merge' and 'rebase'

 respectively.
Create branch

                              You are here


                       B1




                                             Master




 $ git branch <branch_name>
Switch between branch



                       B1




                                               Master



                       B2


                                You are here




 $ git checkout <branch_name>
Merge branch



                    B1
                             You are here



                                            Master




 $ git merge <branch_name>
Tagging



                                         Master




                               Tagged a commit




 $ git tag <commit hash key>
Powered by




             Prathamesh Nevagi

More Related Content

Viewers also liked

جيولوجيا النفط
جيولوجيا النفطجيولوجيا النفط
جيولوجيا النفطslymodi
 
Cc analysis pwrpt
Cc analysis pwrptCc analysis pwrpt
Cc analysis pwrpt
crisiscommou
 
Restauración Cuadros Colegiata de Santiago, Castellar
Restauración Cuadros Colegiata de Santiago, CastellarRestauración Cuadros Colegiata de Santiago, Castellar
Restauración Cuadros Colegiata de Santiago, Castellar
Sara Macias
 
تطبق الصخور
تطبق الصخورتطبق الصخور
تطبق الصخورslymodi
 
Towards Diverse Recommendation
Towards Diverse RecommendationTowards Diverse Recommendation
Towards Diverse Recommendation
neilhurley
 
Tpr( total physical response)
Tpr( total physical response)Tpr( total physical response)
Tpr( total physical response)
Deybi De La O
 
Ingredients list
Ingredients listIngredients list
Ingredients list
Li Colin Cheng
 
Meningoencephalitis in pediatric
Meningoencephalitis in pediatricMeningoencephalitis in pediatric
Meningoencephalitis in pediatric
John Nyeho
 
Tutorial on Robustness of Recommender Systems
Tutorial on Robustness of Recommender SystemsTutorial on Robustness of Recommender Systems
Tutorial on Robustness of Recommender Systems
neilhurley
 
جيولوجيا النفط
جيولوجيا النفطجيولوجيا النفط
جيولوجيا النفطslymodi
 

Viewers also liked (12)

جيولوجيا النفط
جيولوجيا النفطجيولوجيا النفط
جيولوجيا النفط
 
Cc analysis pwrpt
Cc analysis pwrptCc analysis pwrpt
Cc analysis pwrpt
 
Restauración Cuadros Colegiata de Santiago, Castellar
Restauración Cuadros Colegiata de Santiago, CastellarRestauración Cuadros Colegiata de Santiago, Castellar
Restauración Cuadros Colegiata de Santiago, Castellar
 
P (1)
P (1)P (1)
P (1)
 
تطبق الصخور
تطبق الصخورتطبق الصخور
تطبق الصخور
 
Towards Diverse Recommendation
Towards Diverse RecommendationTowards Diverse Recommendation
Towards Diverse Recommendation
 
Tpr( total physical response)
Tpr( total physical response)Tpr( total physical response)
Tpr( total physical response)
 
Ingredients list
Ingredients listIngredients list
Ingredients list
 
P (1)
P (1)P (1)
P (1)
 
Meningoencephalitis in pediatric
Meningoencephalitis in pediatricMeningoencephalitis in pediatric
Meningoencephalitis in pediatric
 
Tutorial on Robustness of Recommender Systems
Tutorial on Robustness of Recommender SystemsTutorial on Robustness of Recommender Systems
Tutorial on Robustness of Recommender Systems
 
جيولوجيا النفط
جيولوجيا النفطجيولوجيا النفط
جيولوجيا النفط
 

Similar to Getting started with GIT

Session git
Session gitSession git
Session git
Roni Saha
 
Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15
Chen-Han Hsiao
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
Piyush Mittal
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
Grace Chien
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
Nguyen Van Hung
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
UshaSuray
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
Arashdeepkaur16
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 
Gitting It Under (Version) Control
Gitting It Under (Version) ControlGitting It Under (Version) Control
Gitting It Under (Version) Control
mobiledevnj
 
github ppt git ppt on git hub to know ab
github ppt git ppt on git hub to know abgithub ppt git ppt on git hub to know ab
github ppt git ppt on git hub to know ab
infoinnext
 
Git
GitGit
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
srinathcox
 
Git slide
Git slideGit slide
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started Presentation
Nap Ramirez
 
Git101
Git101Git101
Git101
Jens Segers
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 

Similar to Getting started with GIT (20)

Session git
Session gitSession git
Session git
 
Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Gitting It Under (Version) Control
Gitting It Under (Version) ControlGitting It Under (Version) Control
Gitting It Under (Version) Control
 
github ppt git ppt on git hub to know ab
github ppt git ppt on git hub to know abgithub ppt git ppt on git hub to know ab
github ppt git ppt on git hub to know ab
 
Git
GitGit
Git
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
 
Git slide
Git slideGit slide
Git slide
 
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started Presentation
 
Git101
Git101Git101
Git101
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git basics
Git basicsGit basics
Git basics
 
Git training v10
Git training v10Git training v10
Git training v10
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 

Getting started with GIT

  • 1. Before and After Without version control system Day 1 Day 2 Day 3 Project Project Project Directory Directory Directory bytes bytes bytes bytes bytes bytes bytes With version control system Day 1 Day 2 Day 3 Project Project Project Directory Directory Directory bytes bytes bytes bytes bytes bytes bytes
  • 2. High level structure Centralized Distributed Team Team Lead Lead Sr.Dev Sr.Dev Central Repository Sr.Dev Sr.Dev Jr.Dev Jr.Dev Jr.Dev Jr.Dev Jr.Dev Jr.Dev Jr.Dev Jr.Dev
  • 3. Features  Distributed development.  Every Developer has full copy.  Most operation are local, so its fast.  Strong support for non-linear development.
  • 4. Create repository Repository created MyProject repo $ git init
  • 5. Clone a repository Remote repo Local repo Cloning complete repository to local $ git clone <url>
  • 6. Adding files/directories (modified) Working Staging directory area stage files $ git add <file/dir name>
  • 7. Committing changes Staging Local Why commit is important : area repo  Each commit gets an SHA1 hash key.  What you put in is what you get out. commits $ git commit -am “<commit message>”
  • 8. Reset changes Working Staging Local directory area repo Add – for modified Or new files Remove for staging area $ git reset $ git reset --hard
  • 9. Key points  Git add : – To add new files. – To add files to staging area (shortcut: commit -a).  Git reset : – Clear staging area. – Clear local changes with “--hard” option.
  • 10. Status of untracked/modified files Working Staging Local directory area repo stage files commits $ git status
  • 11. Remote repository Remote repo Local repo Copy url name only $ git remote add <repo_name> <url>
  • 12. Key points  Git clone : – Creates a new repository by copying everything from an existing repository.  Git remote add : – Creates an entry with the name of a particular url in git config file.
  • 13. Pushing changes Working Staging Local Remote directory area repo repo Push changes $ git push <repo_name> <branch_name>
  • 14. Pulling changes Working Staging Local Remote directory area repo repo Pull changes $ git pull <repo_name> <branch_name>
  • 15. Fetching changes Working Staging Local Remote directory area repo repo Fetch changes Re ba se $ git fetch <repo_name> <branch_name> $ git rebase <repo_name>/<branch_name>
  • 16. Key points  Git pull : – Internally it is 'git fetch' + 'git merge'.  Git fetch : – Gets all the changes but does not apply to working copy.  Git rebase : – Changes the commit history to match remote repo and applies changes to working copy.  There are two ways to integrate changes 'merge' and 'rebase' respectively.
  • 17. Create branch You are here B1 Master $ git branch <branch_name>
  • 18. Switch between branch B1 Master B2 You are here $ git checkout <branch_name>
  • 19. Merge branch B1 You are here Master $ git merge <branch_name>
  • 20. Tagging Master Tagged a commit $ git tag <commit hash key>
  • 21. Powered by Prathamesh Nevagi