SlideShare une entreprise Scribd logo
1  sur  22
Seminar on Git (Version control system)
Anuj
2BA20IS006
Objectives
• Version Control
• Git , Git repository
• Git vs Github
• Setup git environment
• Create a git repository ( adding file, adding folder)
• Checkout different version/ignore files…
• Git tools
2
3
Why Version Control?
Collaboration Versioning Rolling Back Understanding
4
Scenario : Multiple students are doing a project together
Question: Why not Google drive & One drive ????
source code management vs file storage management
Version Control Systems
• Some well-known version control systems are CVS, Subversion,
Mercurial, and Git
5
Why Git?
• Git :most commonly used software for tracking changes in any set of
files, usually used for coordinating work among programmers
collaboratively developing source code during software development.
• Git has many advantages over earlier systems such as CVS and
Subversion
6
Subversion Git
Git History
• Came out of Linux development community
• Linus Torvalds, 2005
• Initial goals:
 Speed
 Support for non-linear development (thousands of parallel branches)
 Fully distributed
 Able to handle large projects like Linux efficiently
 Global Information Tracker (acronym name) 7
What is Github?
• GitHub was developed by Chris Wanstrath, P. J. Hyett, Tom Preston-Werner and Scott
Chacon using Ruby on Rails, and started in February 2008
• It is a subsidiary of Microsoft, which acquired the company in 2018 for $7.5 billion
• GitHub.com is a site for online storage of Git repositories.
• You can get free space for open source projects or you can pay for private projects.
Question: Do I have to use Github in order to use Git?
Answer: No!
• you can use Git completely locally for your own purposes, or
• you or someone else could set up a server to share files, or
• you could share a repo with users on the same file system.
8
Git vs GitHub
9
Download and install Git
• Here’s the standard one:
http://git-scm.com/downloads
• Git Repository is a place where Git can store versions of our
files
• $ cd ~/gitclass
• $ mkdir demo
• $ cd demo
• $ git init
• $ dir /ah or $ ls -a (* .git directory to store all the tracing info)
10
Introduce yourself to Git
• Enter these lines (with appropriate changes):
• git config user.name "John Smith"
• git config user.email jsmith@gmu.edu
• --global param
11
Git Command
12
command description
git clone url [dir] copy a git repository so you can add to it
git add files adds file contents to the staging area
git commit records a snapshot of the staging area
git status view the status of your files in the
working directory and staging area
git diff shows diff of what is staged and what is
modified but unstaged
git help [command] get help info about a particular command
git pull fetch from a remote repo and try to
merge into the current branch
git push push your new branches and data to a
remote repository
others: init, reset, branch, checkout, merge, log, tag
Adding a file to git repository
13
Adding a file to git repository
• Create a rose.txt file ,copy rose.txt to demo folder
• $git checkout -b main
• Git status $git status
• $ git add rose.txt
• $ git status
• $ git commit -m “my first file checked in “
• $ git log
14
Continue…
• Change rose.txt file
• $git status
• $git diff
• $git commit -a –m “new message….”
15
Adding new folder
• $mkdir poem
• copy two text files to that poem folder
• $git add poem
16
git diff HEAD~1 mars.txt
Adding Multimpule files…
17
18
Checking previous version
19
• $ git diff HEAD~1 rose.txt
• $git checkout HEAD~1 rose.txt
• $git checkout HEAD rose.txt
Ignoring Things
• Configure Git to ignore specific files.
• Explain why ignoring files can be useful.
• Copy results folder with files
• Create .gitignore file
• Add
*.dat
results/
20
Git Tools
21
Windows Git Clients:
•Sourcetree
•GitHub for Windows .
•Tortoise Git
Mac Git Clients:
•GitUp
•GitBox
•Git-Xdev
Thank You
22

Contenu connexe

Similaire à Git is a distributed version control system .

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
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
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
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsGorav Singal
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 WorkshopJoy Seng
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 

Similaire à Git is a distributed version control system . (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 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
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
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Git 101 for_tarad_dev
Git 101 for_tarad_devGit 101 for_tarad_dev
Git 101 for_tarad_dev
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Learning git
Learning gitLearning git
Learning git
 
Git-Basics
Git-BasicsGit-Basics
Git-Basics
 
Git and github
Git and githubGit and github
Git and github
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 

Dernier

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
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Dernier (20)

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...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Git is a distributed version control system .

  • 1. Seminar on Git (Version control system) Anuj 2BA20IS006
  • 2. Objectives • Version Control • Git , Git repository • Git vs Github • Setup git environment • Create a git repository ( adding file, adding folder) • Checkout different version/ignore files… • Git tools 2
  • 3. 3
  • 4. Why Version Control? Collaboration Versioning Rolling Back Understanding 4 Scenario : Multiple students are doing a project together Question: Why not Google drive & One drive ???? source code management vs file storage management
  • 5. Version Control Systems • Some well-known version control systems are CVS, Subversion, Mercurial, and Git 5
  • 6. Why Git? • Git :most commonly used software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. • Git has many advantages over earlier systems such as CVS and Subversion 6 Subversion Git
  • 7. Git History • Came out of Linux development community • Linus Torvalds, 2005 • Initial goals:  Speed  Support for non-linear development (thousands of parallel branches)  Fully distributed  Able to handle large projects like Linux efficiently  Global Information Tracker (acronym name) 7
  • 8. What is Github? • GitHub was developed by Chris Wanstrath, P. J. Hyett, Tom Preston-Werner and Scott Chacon using Ruby on Rails, and started in February 2008 • It is a subsidiary of Microsoft, which acquired the company in 2018 for $7.5 billion • GitHub.com is a site for online storage of Git repositories. • You can get free space for open source projects or you can pay for private projects. Question: Do I have to use Github in order to use Git? Answer: No! • you can use Git completely locally for your own purposes, or • you or someone else could set up a server to share files, or • you could share a repo with users on the same file system. 8
  • 10. Download and install Git • Here’s the standard one: http://git-scm.com/downloads • Git Repository is a place where Git can store versions of our files • $ cd ~/gitclass • $ mkdir demo • $ cd demo • $ git init • $ dir /ah or $ ls -a (* .git directory to store all the tracing info) 10
  • 11. Introduce yourself to Git • Enter these lines (with appropriate changes): • git config user.name "John Smith" • git config user.email jsmith@gmu.edu • --global param 11
  • 12. Git Command 12 command description git clone url [dir] copy a git repository so you can add to it git add files adds file contents to the staging area git commit records a snapshot of the staging area git status view the status of your files in the working directory and staging area git diff shows diff of what is staged and what is modified but unstaged git help [command] get help info about a particular command git pull fetch from a remote repo and try to merge into the current branch git push push your new branches and data to a remote repository others: init, reset, branch, checkout, merge, log, tag
  • 13. Adding a file to git repository 13
  • 14. Adding a file to git repository • Create a rose.txt file ,copy rose.txt to demo folder • $git checkout -b main • Git status $git status • $ git add rose.txt • $ git status • $ git commit -m “my first file checked in “ • $ git log 14
  • 15. Continue… • Change rose.txt file • $git status • $git diff • $git commit -a –m “new message….” 15
  • 16. Adding new folder • $mkdir poem • copy two text files to that poem folder • $git add poem 16 git diff HEAD~1 mars.txt
  • 18. 18
  • 19. Checking previous version 19 • $ git diff HEAD~1 rose.txt • $git checkout HEAD~1 rose.txt • $git checkout HEAD rose.txt
  • 20. Ignoring Things • Configure Git to ignore specific files. • Explain why ignoring files can be useful. • Copy results folder with files • Create .gitignore file • Add *.dat results/ 20
  • 21. Git Tools 21 Windows Git Clients: •Sourcetree •GitHub for Windows . •Tortoise Git Mac Git Clients: •GitUp •GitBox •Git-Xdev