SlideShare a Scribd company logo
1 of 26
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 & Containersjonatanblue
 
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 LispVladimir Sedach
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleOrestes 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 CoffeeSarah 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 HelmanHakka Labs
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bowerJitendra 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 containersClaus Ibsen
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using GitSusan Potter
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
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 helmPau López
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratchMir 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 Chefbridgetkromhout
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh 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 containersClaus 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 deployPau 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

C Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen EngagementC Jagdishan - Smart Cities Citizen Engagement
C Jagdishan - Smart Cities Citizen EngagementJagdishan Chandrasekharan
 
Group 5 Revised Country Profile
Group 5 Revised Country ProfileGroup 5 Revised Country Profile
Group 5 Revised Country ProfileSarah Iskander
 
ser324gjhgt14314hkl
ser324gjhgt14314hklser324gjhgt14314hkl
ser324gjhgt14314hkloliscious
 
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 BogorDeviPurnama
 
Shah medium of instruction
Shah medium of instructionShah medium of instruction
Shah medium of instructionSalma Istikhar
 
Seminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - MestradoSeminario didático de pesquisa - Mestrado
Seminario didático de pesquisa - MestradoProfª 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
 

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 and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
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 slideRaghavendraVattikuti1
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor 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 basicsChris Bohatka
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
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
 
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 GitGeoff Hoffman
 
11 git version control
11 git version control11 git version control
11 git version controlWasim 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
 

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

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...Amil Baba Dawood bangali
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsDILIPKUMARMONDAL6
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 

Recently uploaded (20)

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teams
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 

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 하면 안 되는지 설명