SlideShare a Scribd company logo
git
Yeast Liu
2014.04.01 @ NISRA
Outline
• About Version Control
• Hello, Git!
• Git GUI
• Git Branching
Outline
• About Version Control
• What is “Version Control” ?
• Version Control Systems
• Local Version Control Systems
• Centralized Version Control Systems
• Distributed Version Control Systems
• Hello, Git!
• Git GUI
• Git Branching
About Version Control
• What is version control ?
• Local Version Control Systems
• 在 local 各自建立版本資料庫
• 協作開發困難
• Centralized Version Control Systems
• 利用一台中央 Server 儲存所有版本紀錄
• SVN ( Subversion )
• Server 負擔大
• Distributed Version Control Systems
• 每個 local 都有一個版本資料庫
• git
Local Version Control Systems
commit
Centralized Version Control Systems
commit
Distributed
Version Control
Systems
commit
push/pull
Outline
• About Version Control
• Hello, Git!
• What is Git?
• Getting Started
• Git Basics
• Git and Github
• Git GUI
• Git Branching
What is Git?
• A distributed version control system.
• Designed and developed by Linus Torvalds.
• A distributed revision control and source code
management system.
What is Git? – Other VCS
• Store data as changes.
What is Git? – Git VCS
• DAG ( Directed Acyclic Graph):
Store data as snapshots.
Outline
• About Version Control
• Hello, Git!
• What is Git?
• Getting Started
• Installing Git
• First-Time Git Setup
• Get Help
• Git Basics
• Git and Github
• Git GUI
• Git Branching
Getting Started : Installing Git
• Install git on Windows
• Install git on Ubuntu
$ sudo apt-get install git
http://msysgit.github.io/
Getting Started : Git Setup
$ git config --global user.name “Your Name”
• First-Time git setup
$ git config --global user.email “Your Email”
Getting Started : Git Setup
$ cat ~/.gitconfig or
$ vim ~/.gitconfig or
$ git config –list
• Check your git configuration.
• ~/.gitconfig
• 是隱藏在 home folder 中的設定檔
Getting Started : Getting Help
$ git help <command> or
$ git <command> --help
• Get the manual page for help.
$ git help config
Outline
• About Version Control
• Hello, Git!
• What is Git?
• Getting Started
• Git Basics
• Git Repository
• Commands
• Git and Github
• Git GUI
• Git Branching
Getting Basics : Git Repository (Repo)
• Repositories
• 一個儲存專案中所有修訂資訊、歷史紀錄的資料庫
• .git 是一個隱藏目錄, 存放 Repo 所需要的資訊.
Getting Basics : Git Repository (Repo)
Git Basics : Git Repository (Repo)
• Git Repo : 一個被 Git 追蹤的專案
• Repo stored the collection of files and their
complete history.
Git Basics : Git Repository (Repo)
3
3
Outline
• About Version Control
• Hello, Git!
• What is Git?
• Getting Started
• Git Basics
• Git Repository
• Commands
• Git and Github
• Git GUI
• Git Branching
Git Basics : Commands
• Create a empty directory.
• Create git repository.
$ mkdir hellogit
$ cd hellogit
$ git init
Git Basics : Commands
• Create content
• Show content
$ touch data.txt
$ echo “content” > data.txt
$ echo “concat” >> data.txt
$ cat data.txt
Git Basics : Commands
• See the current status.
$ git status
Git Basics : Commands
• Add file to the staging area.
$ git add data.txt
$ git add .
Git Basics : Commands
• Remove file to the staging area.
$ git rm data.txt
Git Basics : Commands
• Commit file to the local repository.
$ git commit –m “Your commit msg”
Git Basics : Commands
• Show git log for the change.
$ git log
Outline
• About Version Control
• Hello, Git!
• What is Git?
• Getting Started
• Git Basics
• Git and Github
• Git GUI
• Git Branching
• Make a new repository on GitHub.
Github : Git and Github
• Make a new repository on GitHub.
Github : Git and Github
“Your Repo Name”
• Creates a remote named “origin” pointing at
your github repo.
Github : Git and Github
$ git remote add origin “URL”
“ URL ”
• Push your commit.
Github : Git and Github
$ git push origin master
• Push your commit.
Github : Git and Github
$ git push origin master
• Push your commit.
Github : Git and Github
Outline
• About Version Control
• Hello, Git!
• Git GUI
• Git Branching
Git GUI
• Graphical Git Client for Linux
• Git-cola
• Gitg
• SmartGit
• Giggle
• Git Gui
• qGit
• gitk
Git GUI
• Gitk
Outline
• About Version Control
• Hello, Git!
• Git GUI
• Git Branching
• Data Structures
• About Branching
• Merge Branches
Git Branching : Data Structures
紀錄檔案內容
檔案目錄
紀錄訊息
Git Branching : Data Structures
• Single commit repository data.
Git Branching : Data Structures
• Git object data for multiple commits.
Outline
• About Version Control
• Hello, Git!
• Git GUI
• Git Branching
• Data Structures
• About Branching
• Merge Branches
Git Branching: About Branching
• Create a new branch.
$ git branch testing
“ Your branch name”
Git Branching: About Branching
• Switch to an existing branch.
$ git checkout testing
“ Your branch name”
Git Branching: About Branching
• Switch to an existing branch.
$ git checkout testing
“ Your branch name”
Outline
• About Version Control
• Hello, Git!
• Git GUI
• Git Branching
• Data Structures
• About Branching
• Merge Branches
Git Branching: Merge Branches
$ git checkout –b iss53
“ Your branch name”
Git Branching: Merge Branches
index.html
$ vim index.html
$ git add
$ git commit –m “issue 53”
index.html
index.html
$ git checkout master
$ git checkout –b hotfix
$ vim index.html
$ vim add
$ git commit –m “hotfix”
index.html
index.html
$ git checkout master
$ git merge hotfix
$ git branch –d hotfix
$ git checkout master
$ git merge iss53
master and iss53 :
no common ancestors
master and iss53 :
no common ancestors
Reference
• Git Documentation
• http://git-scm.com/documentation
• 版本控制系統Git 精要| ihower 的Git 教室
• http://ihower.tw/git/remote.html
• 寫給大家的Git 教學
• http://www.slideshare.net/littlebtc/git-5528339
Q & A 愚人節快樂 :)

More Related Content

What's hot

Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1
ahmadezzeir
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
WSO2
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
 
Davinci git brown_bag
Davinci git brown_bagDavinci git brown_bag
Davinci git brown_bag
Jason Noble
 
Git-Basics
Git-BasicsGit-Basics
Git-Basics
Bhawna Tuteja
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
APNIC Hackathon The Lord of IPv6
APNIC Hackathon The Lord of IPv6APNIC Hackathon The Lord of IPv6
APNIC Hackathon The Lord of IPv6
Siena Perry
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Git presentation
Git presentationGit presentation
Git presentation
Edson Celio
 
An introductory guide to GIT
An introductory guide to GITAn introductory guide to GIT
An introductory guide to GIT
Amith jayasekara
 
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
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
Lorna Mitchell
 
An introduction to git
An introduction to gitAn introduction to git
An introduction to git
Shakeel Tariq
 
Git journey from mars to neon EclipseCon North America - 2016-03-08
Git journey from mars to neon   EclipseCon North America - 2016-03-08Git journey from mars to neon   EclipseCon North America - 2016-03-08
Git journey from mars to neon EclipseCon North America - 2016-03-08
msohn
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
Make Git Understand Excel Workbooks - Eusprig 2018
Make Git Understand Excel Workbooks - Eusprig 2018Make Git Understand Excel Workbooks - Eusprig 2018
Make Git Understand Excel Workbooks - Eusprig 2018
Björn Stiel
 
GitHub
GitHubGitHub
GitHub
ThomasLai27
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
Git intro - agilsun
Git intro - agilsunGit intro - agilsun
Git intro - agilsun
Toàn Hà Thanh
 

What's hot (20)

Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Davinci git brown_bag
Davinci git brown_bagDavinci git brown_bag
Davinci git brown_bag
 
Git-Basics
Git-BasicsGit-Basics
Git-Basics
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
APNIC Hackathon The Lord of IPv6
APNIC Hackathon The Lord of IPv6APNIC Hackathon The Lord of IPv6
APNIC Hackathon The Lord of IPv6
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
 
Git presentation
Git presentationGit presentation
Git presentation
 
An introductory guide to GIT
An introductory guide to GITAn introductory guide to GIT
An introductory guide 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
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
An introduction to git
An introduction to gitAn introduction to git
An introduction to git
 
Git journey from mars to neon EclipseCon North America - 2016-03-08
Git journey from mars to neon   EclipseCon North America - 2016-03-08Git journey from mars to neon   EclipseCon North America - 2016-03-08
Git journey from mars to neon EclipseCon North America - 2016-03-08
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
 
Make Git Understand Excel Workbooks - Eusprig 2018
Make Git Understand Excel Workbooks - Eusprig 2018Make Git Understand Excel Workbooks - Eusprig 2018
Make Git Understand Excel Workbooks - Eusprig 2018
 
GitHub
GitHubGitHub
GitHub
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Git intro - agilsun
Git intro - agilsunGit intro - agilsun
Git intro - agilsun
 

Similar to Git

Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
 
Github
GithubGithub
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Colin Su
 
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 is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
HELLOWorld889594
 
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
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
Cesar Martinez
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
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
Robert Lee-Cann
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Rueful Robin
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
tnscharishma
 
Git简介
Git简介Git简介
Git简介
clvrobj
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
Adham Saad
 
Git basics
Git basicsGit basics
Git basics
terencechia88
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
ssusered2ec2
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Git basics
Git basicsGit basics
Git basics
glitchdata
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 

Similar to Git (20)

Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Github
GithubGithub
Github
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
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
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
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 GitHub
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
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 and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
 
Git简介
Git简介Git简介
Git简介
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Git basics
Git basicsGit basics
Git basics
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git basics
Git basicsGit basics
Git basics
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 

Recently uploaded

How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Vivekanand Anglo Vedic Academy
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 

Recently uploaded (20)

How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 

Git

  • 2. Outline • About Version Control • Hello, Git! • Git GUI • Git Branching
  • 3. Outline • About Version Control • What is “Version Control” ? • Version Control Systems • Local Version Control Systems • Centralized Version Control Systems • Distributed Version Control Systems • Hello, Git! • Git GUI • Git Branching
  • 4. About Version Control • What is version control ? • Local Version Control Systems • 在 local 各自建立版本資料庫 • 協作開發困難 • Centralized Version Control Systems • 利用一台中央 Server 儲存所有版本紀錄 • SVN ( Subversion ) • Server 負擔大 • Distributed Version Control Systems • 每個 local 都有一個版本資料庫 • git
  • 5. Local Version Control Systems commit
  • 8. Outline • About Version Control • Hello, Git! • What is Git? • Getting Started • Git Basics • Git and Github • Git GUI • Git Branching
  • 9. What is Git? • A distributed version control system. • Designed and developed by Linus Torvalds. • A distributed revision control and source code management system.
  • 10. What is Git? – Other VCS • Store data as changes.
  • 11. What is Git? – Git VCS • DAG ( Directed Acyclic Graph): Store data as snapshots.
  • 12. Outline • About Version Control • Hello, Git! • What is Git? • Getting Started • Installing Git • First-Time Git Setup • Get Help • Git Basics • Git and Github • Git GUI • Git Branching
  • 13. Getting Started : Installing Git • Install git on Windows • Install git on Ubuntu $ sudo apt-get install git http://msysgit.github.io/
  • 14. Getting Started : Git Setup $ git config --global user.name “Your Name” • First-Time git setup $ git config --global user.email “Your Email”
  • 15. Getting Started : Git Setup $ cat ~/.gitconfig or $ vim ~/.gitconfig or $ git config –list • Check your git configuration. • ~/.gitconfig • 是隱藏在 home folder 中的設定檔
  • 16. Getting Started : Getting Help $ git help <command> or $ git <command> --help • Get the manual page for help. $ git help config
  • 17. Outline • About Version Control • Hello, Git! • What is Git? • Getting Started • Git Basics • Git Repository • Commands • Git and Github • Git GUI • Git Branching
  • 18. Getting Basics : Git Repository (Repo) • Repositories • 一個儲存專案中所有修訂資訊、歷史紀錄的資料庫 • .git 是一個隱藏目錄, 存放 Repo 所需要的資訊.
  • 19. Getting Basics : Git Repository (Repo)
  • 20. Git Basics : Git Repository (Repo) • Git Repo : 一個被 Git 追蹤的專案 • Repo stored the collection of files and their complete history.
  • 21. Git Basics : Git Repository (Repo) 3 3
  • 22. Outline • About Version Control • Hello, Git! • What is Git? • Getting Started • Git Basics • Git Repository • Commands • Git and Github • Git GUI • Git Branching
  • 23. Git Basics : Commands • Create a empty directory. • Create git repository. $ mkdir hellogit $ cd hellogit $ git init
  • 24. Git Basics : Commands • Create content • Show content $ touch data.txt $ echo “content” > data.txt $ echo “concat” >> data.txt $ cat data.txt
  • 25. Git Basics : Commands • See the current status. $ git status
  • 26. Git Basics : Commands • Add file to the staging area. $ git add data.txt $ git add .
  • 27. Git Basics : Commands • Remove file to the staging area. $ git rm data.txt
  • 28. Git Basics : Commands • Commit file to the local repository. $ git commit –m “Your commit msg”
  • 29. Git Basics : Commands • Show git log for the change. $ git log
  • 30. Outline • About Version Control • Hello, Git! • What is Git? • Getting Started • Git Basics • Git and Github • Git GUI • Git Branching
  • 31.
  • 32. • Make a new repository on GitHub. Github : Git and Github
  • 33. • Make a new repository on GitHub. Github : Git and Github “Your Repo Name”
  • 34. • Creates a remote named “origin” pointing at your github repo. Github : Git and Github $ git remote add origin “URL” “ URL ”
  • 35. • Push your commit. Github : Git and Github $ git push origin master
  • 36. • Push your commit. Github : Git and Github $ git push origin master
  • 37. • Push your commit. Github : Git and Github
  • 38. Outline • About Version Control • Hello, Git! • Git GUI • Git Branching
  • 39. Git GUI • Graphical Git Client for Linux • Git-cola • Gitg • SmartGit • Giggle • Git Gui • qGit • gitk
  • 41. Outline • About Version Control • Hello, Git! • Git GUI • Git Branching • Data Structures • About Branching • Merge Branches
  • 42. Git Branching : Data Structures 紀錄檔案內容 檔案目錄 紀錄訊息
  • 43. Git Branching : Data Structures • Single commit repository data.
  • 44. Git Branching : Data Structures • Git object data for multiple commits.
  • 45. Outline • About Version Control • Hello, Git! • Git GUI • Git Branching • Data Structures • About Branching • Merge Branches
  • 46. Git Branching: About Branching • Create a new branch. $ git branch testing “ Your branch name”
  • 47. Git Branching: About Branching • Switch to an existing branch. $ git checkout testing “ Your branch name”
  • 48. Git Branching: About Branching • Switch to an existing branch. $ git checkout testing “ Your branch name”
  • 49. Outline • About Version Control • Hello, Git! • Git GUI • Git Branching • Data Structures • About Branching • Merge Branches
  • 50. Git Branching: Merge Branches $ git checkout –b iss53 “ Your branch name”
  • 51. Git Branching: Merge Branches index.html $ vim index.html $ git add $ git commit –m “issue 53”
  • 52. index.html index.html $ git checkout master $ git checkout –b hotfix $ vim index.html $ vim add $ git commit –m “hotfix”
  • 53. index.html index.html $ git checkout master $ git merge hotfix $ git branch –d hotfix
  • 54. $ git checkout master $ git merge iss53
  • 55. master and iss53 : no common ancestors
  • 56. master and iss53 : no common ancestors
  • 57. Reference • Git Documentation • http://git-scm.com/documentation • 版本控制系統Git 精要| ihower 的Git 教室 • http://ihower.tw/git/remote.html • 寫給大家的Git 教學 • http://www.slideshare.net/littlebtc/git-5528339
  • 58. Q & A 愚人節快樂 :)