SlideShare a Scribd company logo
Git & GitHub
12/30(Wed) Hypercomputer Seminar
Taehwan Kim
maxtortime@gmail.com
http://fast.ajou.ac.kr
DVCS ? CVCS ?
• Git based on DVCS
(Distributed Version
Control System).
• DVCS just mirrors full
repositories, unlike
CVCS.
• CVCS (Central Version
Control System) only
checkouts file’s final
snapshot.
Why should you use Git?
• If you use a SVN, you will lose all history when main server is
damaged. You can recover only your final snapshot.
• But If you use a Git, recovering is very easy because you just
choose one of the repositories. (think previous slide’s image)
• DVCS environment can have multiple remote repositories,
so you can work together various group and people.
Snapshots, Not Differences
Git don’t save difference of file, just take a picture of
file at that moment. Git thinks about its data more
like a stream of snapshots.
Git has the three states.
1. ‘Committed’ means that the data saved safely on the
repo.
2. ‘Modified’ means that you have changed the file but
have not committed it to your repo.
3. ‘Staged’ means that you have marked a modified file
in its current version to go into your next commit
snapshot.
Diagram of Git states.
Files in your working directory
• Tracked: Already contains in snapshot. (above three
states, committed, (un)modified, staged.
• Untracked: Your files don’t contain snapshot or
staging area.
Git: GUI vs CLI ??
• Today’s seminar’s goal is becoming skillful for using
Git in terminal environment.
• The command line(CLI) is the only place you can
run all Git commands.
USING GIT WELL IN
GUI ENVIRONMENT
USING GIT WELL IN
TERMINAL
ENVIRONMENT
CAN
CANNOT
$ git clone
1. Using HTTPS
$ git clone https://github.com/username/foo.git
2. Using SSH
$ git clone git@github.com:username/foo.git
1. Clone repo. Using HTTPS
• Authentication with username and password.
• You don’t have to set anything.
• But you should type username and password every
time when push, pull, fetch.
• You can use a credential storage but I think that its
setting is more complex than SSH.
2. Clone repo. Using SSH
• Auth. and send data using SSH protocol.
• Most of operating systems have SSH daemon and
management tools. So, setting is very easy.
• But, you should register public key to git hosting
server EACH DEVICES.
• From my experience, I think that register key is
better than remembering password.
How to generate SSH keys.
• First, you should generate your public SSH key.
$ ssh-keygen
• Many options for making key, but Now, we just
become YESMAN. (more information)
• Copy your public key to clipboard. Your key files is
in ~/.ssh/id_rsa.pub
• Turn on your Internet Browser and go to
http://github.com
Register public key to GitHub
Remote repository ?
• After clone project. Your local git repo has ‘origin’
remote repo.
• How to check remote repo?
$ git remote –v # show URL and remote name
• You can add more remote repo.
$ git remote add <name> <URL>
• Therefore, you can use multiple protocol using
above commands.
• More information
Checkout? Remote Branch?
• After clone repo, your current branch is ‘master’
and there is no local branch.
• But you want to work at ‘foo’ branch which your
co-worker worked before.
• How to move that branch?
$ git checkout origin/foo –b foo
• origin/foo is a remote branch of origin (remote
repo) and foo is your local branch.
$ git checkout
• You can move branch and restore something.
• In other words, ‘git checkout origin/foo’ means
now you want to move to origin/foo branch.
• ‘-b’ option means making new branch while moving.
• Q. Why not just type ‘git checkout –b origin/foo’?
• If your working directory is dirty, you should
arrange your directory. (more info..)
• If you change branch using checkout, your working
directory will be changed.
$ git branch
• If you just want to make a new branch.
$ git branch testing
# foo1 also directs current working branch.
• How to determine current working branch?
Git has a pointer ‘HEAD’.
$ git log
• git log show commit histories.
• -2 , n : show only 2 .. n histories.
• --oneline : show each log one line.
• --decorators : show connected branch.
• --grep <string> : show histories contain <string>
• … many options.
What is a branch?
• Git branch is just SHA-1 checksum files direct to
some commit.
• So, it is very easy to make or delete branch.
• Each branches save previous commit’s information.
• Therefore, developers make and delete branch
often.
Fast-Forward merge.
When A merge to B, If B directs the commit which
after A, just A directs B’s commit.
3-Way merge.
• When current branch’s commit is not ancestor of
target branch’s commit.
• 3-Way merge occurs CONFILCT when two branch
modify same part of one file.
How to check CONFILCTS
• After commit failed, you can know conflicted file.
$ git merge iss53
Auto-merging index.html
CONFILCT (content) : Merge conflict in index.html
Automatic merge failed; fix conflicts and then
commit the result.
• You also check unmerged file by ‘$ git status’
commands
How to resolve CONFILCTS
First, open unmerged file by text editor.
HEAD means your current branch and below of
=====.. means your target branch. You just choose
contents each branches or write new contents.
Fetch vs Pull
• Fetch just sync with remote repo.
• Pull merges remote branch and download data
from remote repo at the same time.
(fetch + merge)
• Example
$ git fetch origin
# Just download data from remote repo.
$ git pull origin master
# Merge origin/master to master
Thank you for listening!
Read https://git-scm.com/book/ko/v2 and keep studying!

More Related Content

What's hot

Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
jonatanblue
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
Orestes Carracedo
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
Mongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanMongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam Helman
Hakka Labs
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bower
Jitendra Zaa
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
Victor S. Recio
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
Susan Potter
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
Diacode
 
Subversion
SubversionSubversion
Introducing Wordpress Multitenancy
Introducing Wordpress MultitenancyIntroducing Wordpress Multitenancy
Introducing Wordpress Multitenancy
Salesforce Engineering
 
Built in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helmBuilt in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helm
Pau López
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratch
Mir Arif Hasan
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
Build in continuous integration, delivery and deploy
Build in continuous integration, delivery and deployBuild in continuous integration, delivery and deploy
Build in continuous integration, delivery and deploy
Pau López
 

What's hot (20)

Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
Mongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanMongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam Helman
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bower
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Subversion
SubversionSubversion
Subversion
 
Introducing Wordpress Multitenancy
Introducing Wordpress MultitenancyIntroducing Wordpress Multitenancy
Introducing Wordpress Multitenancy
 
Built in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helmBuilt in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helm
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratch
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Build in continuous integration, delivery and deploy
Build in continuous integration, delivery and deployBuild in continuous integration, delivery and deploy
Build in continuous integration, delivery and deploy
 

Viewers also liked

Presentation2
Presentation2Presentation2
Presentation2
asefa asdfawf
 
C Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen EngagementC Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen Engagement
Jagdishan Chandrasekharan
 
How do you eat an elephant
How do you eat an elephantHow do you eat an elephant
How do you eat an elephant
Jesper Færgemann
 
Group 5 Revised Country Profile
Group 5 Revised Country ProfileGroup 5 Revised Country Profile
Group 5 Revised Country ProfileSarah Iskander
 
ser324gjhgt14314hkl
ser324gjhgt14314hklser324gjhgt14314hkl
ser324gjhgt14314hkloliscious
 
Bloco K
Bloco KBloco K
Unsur unsur transisi kelompok 4 SMK-SMAK Bogor
Unsur unsur transisi kelompok 4 SMK-SMAK BogorUnsur unsur transisi kelompok 4 SMK-SMAK Bogor
Unsur unsur transisi kelompok 4 SMK-SMAK Bogor
DeviPurnama
 
Shah medium of instruction
Shah medium of instructionShah medium of instruction
Shah medium of instruction
Salma Istikhar
 
Unsur periode 3
Unsur periode 3Unsur periode 3
Unsur periode 3
Magma Rachmani
 
Seminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - MestradoSeminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - Mestrado
Profª Alda Ernestina
 
Seminário didático - Doutorado
Seminário didático - Doutorado  Seminário didático - Doutorado
Seminário didático - Doutorado
Profª Alda Ernestina
 
Performance Management & Strategic Planning {Lecture Notes}
Performance Management & Strategic Planning {Lecture Notes}Performance Management & Strategic Planning {Lecture Notes}
Performance Management & Strategic Planning {Lecture Notes}
FellowBuddy.com
 
Kimia unsur ppt
Kimia unsur pptKimia unsur ppt
Kimia unsur ppt
rahayuviraa
 

Viewers also liked (15)

Presentation2
Presentation2Presentation2
Presentation2
 
C Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen EngagementC Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen Engagement
 
How do you eat an elephant
How do you eat an elephantHow do you eat an elephant
How do you eat an elephant
 
Group 5 Revised Country Profile
Group 5 Revised Country ProfileGroup 5 Revised Country Profile
Group 5 Revised Country Profile
 
ser324gjhgt14314hkl
ser324gjhgt14314hklser324gjhgt14314hkl
ser324gjhgt14314hkl
 
Bloco K
Bloco KBloco K
Bloco K
 
Mumbai2
Mumbai2Mumbai2
Mumbai2
 
Unsur unsur transisi kelompok 4 SMK-SMAK Bogor
Unsur unsur transisi kelompok 4 SMK-SMAK BogorUnsur unsur transisi kelompok 4 SMK-SMAK Bogor
Unsur unsur transisi kelompok 4 SMK-SMAK Bogor
 
Shah medium of instruction
Shah medium of instructionShah medium of instruction
Shah medium of instruction
 
Unsur periode 3
Unsur periode 3Unsur periode 3
Unsur periode 3
 
Seminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - MestradoSeminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - Mestrado
 
Seminário didático - Doutorado
Seminário didático - Doutorado  Seminário didático - Doutorado
Seminário didático - Doutorado
 
Performance Management & Strategic Planning {Lecture Notes}
Performance Management & Strategic Planning {Lecture Notes}Performance Management & Strategic Planning {Lecture Notes}
Performance Management & Strategic Planning {Lecture Notes}
 
Kimia unsur ppt
Kimia unsur pptKimia unsur ppt
Kimia unsur ppt
 
rapport_2012-1
rapport_2012-1rapport_2012-1
rapport_2012-1
 

Similar to Git and GitHub

Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
Chris Ballance
 
Working with Git
Working with GitWorking with Git
Working with Git
Tony Hillerson
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
RaghavendraVattikuti1
 
Git 101
Git 101Git 101
Git 101
Sachet Mittal
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
 
Git hub
Git hubGit hub
Git hub
Nitin Goel
 
Working with Git
Working with GitWorking with Git
Working with Git
Sanghoon Hong
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
Paradigma Digital
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 
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
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Ahmed El-Arabawy
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 

Similar to Git and GitHub (20)

Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git 101
Git 101Git 101
Git 101
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Git hub
Git hubGit hub
Git hub
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
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
 
11 git version control
11 git version control11 git version control
11 git version control
 
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
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 

Recently uploaded

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 

Recently uploaded (20)

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 

Git and GitHub

  • 1. Git & GitHub 12/30(Wed) Hypercomputer Seminar Taehwan Kim maxtortime@gmail.com http://fast.ajou.ac.kr
  • 2. DVCS ? CVCS ? • Git based on DVCS (Distributed Version Control System). • DVCS just mirrors full repositories, unlike CVCS. • CVCS (Central Version Control System) only checkouts file’s final snapshot.
  • 3. Why should you use Git? • If you use a SVN, you will lose all history when main server is damaged. You can recover only your final snapshot. • But If you use a Git, recovering is very easy because you just choose one of the repositories. (think previous slide’s image) • DVCS environment can have multiple remote repositories, so you can work together various group and people.
  • 4. Snapshots, Not Differences Git don’t save difference of file, just take a picture of file at that moment. Git thinks about its data more like a stream of snapshots.
  • 5. Git has the three states. 1. ‘Committed’ means that the data saved safely on the repo. 2. ‘Modified’ means that you have changed the file but have not committed it to your repo. 3. ‘Staged’ means that you have marked a modified file in its current version to go into your next commit snapshot.
  • 6. Diagram of Git states.
  • 7. Files in your working directory • Tracked: Already contains in snapshot. (above three states, committed, (un)modified, staged. • Untracked: Your files don’t contain snapshot or staging area.
  • 8. Git: GUI vs CLI ?? • Today’s seminar’s goal is becoming skillful for using Git in terminal environment. • The command line(CLI) is the only place you can run all Git commands. USING GIT WELL IN GUI ENVIRONMENT USING GIT WELL IN TERMINAL ENVIRONMENT CAN CANNOT
  • 9. $ git clone 1. Using HTTPS $ git clone https://github.com/username/foo.git 2. Using SSH $ git clone git@github.com:username/foo.git
  • 10. 1. Clone repo. Using HTTPS • Authentication with username and password. • You don’t have to set anything. • But you should type username and password every time when push, pull, fetch. • You can use a credential storage but I think that its setting is more complex than SSH.
  • 11. 2. Clone repo. Using SSH • Auth. and send data using SSH protocol. • Most of operating systems have SSH daemon and management tools. So, setting is very easy. • But, you should register public key to git hosting server EACH DEVICES. • From my experience, I think that register key is better than remembering password.
  • 12. How to generate SSH keys. • First, you should generate your public SSH key. $ ssh-keygen • Many options for making key, but Now, we just become YESMAN. (more information) • Copy your public key to clipboard. Your key files is in ~/.ssh/id_rsa.pub • Turn on your Internet Browser and go to http://github.com
  • 13. Register public key to GitHub
  • 14. Remote repository ? • After clone project. Your local git repo has ‘origin’ remote repo. • How to check remote repo? $ git remote –v # show URL and remote name • You can add more remote repo. $ git remote add <name> <URL> • Therefore, you can use multiple protocol using above commands. • More information
  • 15. Checkout? Remote Branch? • After clone repo, your current branch is ‘master’ and there is no local branch. • But you want to work at ‘foo’ branch which your co-worker worked before. • How to move that branch? $ git checkout origin/foo –b foo • origin/foo is a remote branch of origin (remote repo) and foo is your local branch.
  • 16. $ git checkout • You can move branch and restore something. • In other words, ‘git checkout origin/foo’ means now you want to move to origin/foo branch. • ‘-b’ option means making new branch while moving. • Q. Why not just type ‘git checkout –b origin/foo’? • If your working directory is dirty, you should arrange your directory. (more info..) • If you change branch using checkout, your working directory will be changed.
  • 17. $ git branch • If you just want to make a new branch. $ git branch testing # foo1 also directs current working branch. • How to determine current working branch? Git has a pointer ‘HEAD’.
  • 18. $ git log • git log show commit histories. • -2 , n : show only 2 .. n histories. • --oneline : show each log one line. • --decorators : show connected branch. • --grep <string> : show histories contain <string> • … many options.
  • 19.
  • 20. What is a branch? • Git branch is just SHA-1 checksum files direct to some commit. • So, it is very easy to make or delete branch. • Each branches save previous commit’s information. • Therefore, developers make and delete branch often.
  • 21. Fast-Forward merge. When A merge to B, If B directs the commit which after A, just A directs B’s commit.
  • 22. 3-Way merge. • When current branch’s commit is not ancestor of target branch’s commit. • 3-Way merge occurs CONFILCT when two branch modify same part of one file.
  • 23. How to check CONFILCTS • After commit failed, you can know conflicted file. $ git merge iss53 Auto-merging index.html CONFILCT (content) : Merge conflict in index.html Automatic merge failed; fix conflicts and then commit the result. • You also check unmerged file by ‘$ git status’ commands
  • 24. How to resolve CONFILCTS First, open unmerged file by text editor. HEAD means your current branch and below of =====.. means your target branch. You just choose contents each branches or write new contents.
  • 25. Fetch vs Pull • Fetch just sync with remote repo. • Pull merges remote branch and download data from remote repo at the same time. (fetch + merge) • Example $ git fetch origin # Just download data from remote repo. $ git pull origin master # Merge origin/master to master
  • 26. Thank you for listening! Read https://git-scm.com/book/ko/v2 and keep studying!

Editor's Notes

  1. Windows 에서 git bash 를 쓰는 법을 알려줄 것
  2. 같이 해보기
  3. 여기서 왜 여러 프로토콜을 사용할 수 있는지 알려주기
  4. 왜 그냥 –b origin/foo 하면 안 되는지 설명