際際滷

際際滷Share a Scribd company logo
Git & Github Introduction (1)
1
Elaine Ding
Digital Developer in Fenwick Library
George Mason University
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
 Heres 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

More Related Content

Similar to GIT-FirstPart.ppt (20)

Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPBGit and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
Nguyen Van Hung
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
Kim Moir
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
Git and GitHub workshop of GDG on Campus UNSTPB
Git and GitHub workshop of GDG on Campus UNSTPBGit and GitHub workshop of GDG on Campus UNSTPB
Git and GitHub workshop of GDG on Campus UNSTPB
AmaraCostachiu
Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPBGit and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
Cristian Lucchesi
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
Geoff Hoffman
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
Joy Seng
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
BigBlueHat
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
Git-Basics
Git-BasicsGit-Basics
Git-Basics
Bhawna Tuteja
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
Gorav Singal
Mini-training: Lets Git It!
Mini-training: Lets Git It!Mini-training: Lets Git It!
Mini-training: Lets Git It!
Betclic Everest Group Tech Team
GitHub and Open Source - GDGoC MIT Anna University
GitHub and Open Source - GDGoC MIT Anna UniversityGitHub and Open Source - GDGoC MIT Anna University
GitHub and Open Source - GDGoC MIT Anna University
mitgdsc
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
Git 101 for_tarad_dev
Git 101 for_tarad_devGit 101 for_tarad_dev
Git 101 for_tarad_dev
Somkiat Puisungnoen
Git and GitHub PowerPoint Presentation**
Git and GitHub PowerPoint Presentation**Git and GitHub PowerPoint Presentation**
Git and GitHub PowerPoint Presentation**
KalpeshGandha
Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPBGit and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
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
Kim Moir
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
Git and GitHub workshop of GDG on Campus UNSTPB
Git and GitHub workshop of GDG on Campus UNSTPBGit and GitHub workshop of GDG on Campus UNSTPB
Git and GitHub workshop of GDG on Campus UNSTPB
AmaraCostachiu
Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPBGit and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
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
Geoff Hoffman
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
Joy Seng
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
BigBlueHat
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen 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 levels
Gorav Singal
GitHub and Open Source - GDGoC MIT Anna University
GitHub and Open Source - GDGoC MIT Anna UniversityGitHub and Open Source - GDGoC MIT Anna University
GitHub and Open Source - GDGoC MIT Anna University
mitgdsc
Git and GitHub PowerPoint Presentation**
Git and GitHub PowerPoint Presentation**Git and GitHub PowerPoint Presentation**
Git and GitHub PowerPoint Presentation**
KalpeshGandha

Recently uploaded (20)

Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
Adobe InDesign Crack Full Version Free Download 2025
Adobe InDesign Crack  Full Version Free Download 2025Adobe InDesign Crack  Full Version Free Download 2025
Adobe InDesign Crack Full Version Free Download 2025
sannnasaba545
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
haroonsaeed605
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
DevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdfDevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdf
Justin Reock
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost OptimizationNext-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
asmith539880
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Lecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptxLecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
Instagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo websiteInstagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo website
AxisTechnolabs
CorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free downloadCorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free download
fahadmustafa4202
Build the future with Agentforce and Mulesoft
Build the future with Agentforce and  MulesoftBuild the future with Agentforce and  Mulesoft
Build the future with Agentforce and Mulesoft
GiulioPicchi
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
Adobe InDesign Crack Full Version Free Download 2025
Adobe InDesign Crack  Full Version Free Download 2025Adobe InDesign Crack  Full Version Free Download 2025
Adobe InDesign Crack Full Version Free Download 2025
sannnasaba545
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
haroonsaeed605
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
DevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdfDevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdf
Justin Reock
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost OptimizationNext-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
Next-Gen Procurement: Leveraging AI for Smarter Sourcing & Cost Optimization
asmith539880
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Lecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptxLecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
Instagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo websiteInstagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo website
AxisTechnolabs
CorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free downloadCorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free download
fahadmustafa4202
Build the future with Agentforce and Mulesoft
Build the future with Agentforce and  MulesoftBuild the future with Agentforce and  Mulesoft
Build the future with Agentforce and Mulesoft
GiulioPicchi
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi

GIT-FirstPart.ppt

  • 1. Git & Github Introduction (1) 1 Elaine Ding Digital Developer in Fenwick Library George Mason University
  • 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 Heres 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