SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Hosted Git
github
From an alumnus (2010)
 You know, the more time I spent in industry the better
I've understood what a strong advocate you are for the
students in the IT program. You genuinely want to see us
succeed in our careers, above all else.
The Big Picture
http://blog.mikepearce.net/2010/05/18/the-difference-between-git-pull-git-fetch-and-git-clone-and-git-rebase/
Now we’ll talk about this part
GitHub
 Largest open source git hosting site
 Public and private options
 CS collaboration policy: your homework must be stored in a
private repository.
 https://education.github.com/
 User-centric rather than project-centric
 Try it
 Log onto github
 Walk through the tutorials
How do I use github?
 Set up a user account
 public account is free, students can request 5 private
 e.g. CyndiRader
 Remember your password!
 Create a repository
 e.g. GitDemoCode
 Add github as a “remote”
 Push your master branch (later we’ll deal with other
branches, just work with master for now)
 Add collaborators (if public, everyone can read, but not
write. If private, must be collaborator to even read)
http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
Typical workflow
Person A
Setup project & repo
push code onto
github
edit/commit
edit/commit
pull/push
Person B
clone code from
github
edit/commit/push
edit…
edit… commit
pull/push
This is just the flow, specific commands on following slides.
It’s also possible to create your project first on github, then clone (i.e., no git init)
Remote repository
 Remote repository is a bare repository
 There is no working directory
 Four transfer protocols
 http – this is what I recommend/use
 local (not covered – good for shared filesystems)
 git (not covered – fast but more setup)
 SSH (supplementary material at end of slides, not covered)
Smart http
 Added to git in v. 1.6.6
 Read about it:
 http://git-scm.com/2010/03/04/smart-http.html
 Use it on the client:
git clone https://github.com/CyndiRader/JavaDemos.git
protocol userID repository
When you create a repo on github, it will show you the HTTPS clone URL
Avoid typos: a) copy the URL, b) in git bash, click git-icon/edit/paste OR press
Insert.
Create the repo – Option 1
 Log onto github
 Click on + to add repository
 Enter name
 Add .gitignore, good to have a README
 Click on Settings to control access (Collaborators tab)
 On PC, do git clone
Create the repo – Option 2
 Create your Java Project
 Create your local repo
 git init
 git commit –m “Initial commit”
 Create a repo on github
 Add a “shortname” for your git repository
 git remote add [shortname] [url]
 git remote add origin https://github.com:[user name]/[repository name].git
 Ex: git remote add origin https://github.com:CyndiRader/JavaDemos.git
 Remember: You can copy/paste the repo url from github
 Push your code onto github
 git push –u [remote-name] [branch-name].
 Ex: git push –u origin master – enter username/password
Collaborating via github - cloning
 git clone adds the remote repository under the name origin
 git clone https://github.com:[user name]/[repository name].git
 git clone https://github.com:CyndiRader/JavaDemos.git
Example
 Assume I have a repo named GUI2.git
 In Eclipse: (from the directory where the clone was run):
File -> New JavaProject -> GUI2
Push example
 Make a change to one of the files
 See status (I already made one commit)
Push example continued
 Commit changes – updates local repo
Push example, continued
Keep everyone in synch
 Be very careful not to make conflicting changes!
 Merge with conflicts covered later
 Two options for synchronizing:
 Fetch/merge
 Pull
 Pull is usually simpler, but we’ll cover both.
Fetch example - On original machine
 Fetch, merge
fast-forward covered under branching
Pull example – on original machine
 If you’re careful to avoid conflicts, and you’re working on
the master branch, easier to just pull.
 Make some changes on original machine
 Don’t forget to commit! (see push below, didn’t work)
Pull continued
 Note typo. git merge origin/master BUT git push origin
master.
 Merge is specifying the branch to merge (in this case master
branch on remote named origin - branches covered in detail
later).
 Push is specifying the remote and the local branch.
typo
Pull continued – on clone machine
 git pull origin master
 git pull (assumes origin, master)
Supplemental
SSH
 Used to be most common transport for git
 Pros
 Allows reads and writes
 Authenticated network protocol
 Secure: data transfer is encrypted and authenticated
 Efficient: makes data as compact as possible
 Cons
 No anonymous read-only access
Sidebar: What is SSH?
 SSH is a protocol used for secure network
communication
Getting files from github
• Generate public/private keys (ssh-keygen)
• Distribute public keys (add key to github)
• Someone (github) sends secure “message”
(files) – they encode with public key
• You receive the message/files – decode with
private key (only you know)
Putting files on github
• Process is reversed to send files to github
• You have the github public key (see
github_rsa.pub, in Documents and
Settings/Cyndi/.ssh on my machine)
• Use it to encode when sending
• github uses their private key to decode

Weitere ähnliche Inhalte

Was ist angesagt?

Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github SahilSonar4
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexyAilsa126
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at EclipseChris Aniszczyk
 
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal Garg
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal GargGitHub Classroom - An Open Source Learning Platform by Dr. Anchal Garg
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal GargNisha Garg
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon MelbournePaal Ringstad
 
Hello git - a soft introduction to git (Talk Slides)
Hello git - a soft introduction to git (Talk Slides) Hello git - a soft introduction to git (Talk Slides)
Hello git - a soft introduction to git (Talk Slides) Amity University Noida
 
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015DevOpsDays Tel Aviv
 
僕とhuskyとrm -rf .git/
僕とhuskyとrm -rf .git/僕とhuskyとrm -rf .git/
僕とhuskyとrm -rf .git/pmw1415
 
Inside GitHub
Inside GitHubInside GitHub
Inside GitHuberr
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil AliAmilAli1
 
How to store large binary files in git repositories
How to store large binary files in git repositoriesHow to store large binary files in git repositories
How to store large binary files in git repositoriesMatt Aunger
 
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"South Tyrol Free Software Conference
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
 
CraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitCraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitcraftworkz
 

Was ist angesagt? (20)

Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexy
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at Eclipse
 
Git in Eclipse
Git in EclipseGit in Eclipse
Git in Eclipse
 
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal Garg
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal GargGitHub Classroom - An Open Source Learning Platform by Dr. Anchal Garg
GitHub Classroom - An Open Source Learning Platform by Dr. Anchal Garg
 
Git basics
Git basicsGit basics
Git basics
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
Hello git - a soft introduction to git (Talk Slides)
Hello git - a soft introduction to git (Talk Slides) Hello git - a soft introduction to git (Talk Slides)
Hello git - a soft introduction to git (Talk Slides)
 
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
Terrible Ideas in Git - Corey Quinn, FutureAdvisor - DevOpsDays Tel Aviv 2015
 
Git basics
Git basicsGit basics
Git basics
 
僕とhuskyとrm -rf .git/
僕とhuskyとrm -rf .git/僕とhuskyとrm -rf .git/
僕とhuskyとrm -rf .git/
 
Inside GitHub
Inside GitHubInside GitHub
Inside GitHub
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil Ali
 
How to store large binary files in git repositories
How to store large binary files in git repositoriesHow to store large binary files in git repositories
How to store large binary files in git repositories
 
WeCode IL: Save Kermit
WeCode IL:  Save KermitWeCode IL:  Save Kermit
WeCode IL: Save Kermit
 
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
 
いつやるの?Git入門
いつやるの?Git入門いつやるの?Git入門
いつやるの?Git入門
 
git & GitHub workshop
git & GitHub workshopgit & GitHub workshop
git & GitHub workshop
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
 
CraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitCraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to git
 

Andere mochten auch

Sexualidad+ +2do---
Sexualidad+ +2do---Sexualidad+ +2do---
Sexualidad+ +2do---Margaretlu
 
Curso de teclado Aprenda a Tocar Teclado
Curso de teclado  Aprenda a Tocar TecladoCurso de teclado  Aprenda a Tocar Teclado
Curso de teclado Aprenda a Tocar TecladoCleber Lucas
 
EMAAR Vida Residences - Dubai Marina +971 4553 8725
EMAAR Vida Residences - Dubai Marina +971 4553 8725EMAAR Vida Residences - Dubai Marina +971 4553 8725
EMAAR Vida Residences - Dubai Marina +971 4553 8725Sandeepnextgen
 
Corneal degenerations
Corneal degenerationsCorneal degenerations
Corneal degenerationsAkshay Nayak
 
Présentation de Zabbix - Zabbix Toulouse #1 - ZUG
Présentation de Zabbix - Zabbix Toulouse #1 - ZUGPrésentation de Zabbix - Zabbix Toulouse #1 - ZUG
Présentation de Zabbix - Zabbix Toulouse #1 - ZUGZabbix User Group
 
Ciclomobilidade e o PDDU de Salvador
Ciclomobilidade e o PDDU de SalvadorCiclomobilidade e o PDDU de Salvador
Ciclomobilidade e o PDDU de SalvadorPablo Florentino
 
Cardiología 2 sistema de conducción cardíaca
Cardiología 2  sistema de conducción cardíacaCardiología 2  sistema de conducción cardíaca
Cardiología 2 sistema de conducción cardíacaCUCS, UNAM, UAEH y UM
 

Andere mochten auch (13)

kablosuz ağlar
kablosuz ağlarkablosuz ağlar
kablosuz ağlar
 
Sexualidad+ +2do---
Sexualidad+ +2do---Sexualidad+ +2do---
Sexualidad+ +2do---
 
Curso de teclado Aprenda a Tocar Teclado
Curso de teclado  Aprenda a Tocar TecladoCurso de teclado  Aprenda a Tocar Teclado
Curso de teclado Aprenda a Tocar Teclado
 
El coltan
El coltanEl coltan
El coltan
 
OYSTER STORY
OYSTER STORYOYSTER STORY
OYSTER STORY
 
Loops in flow
Loops in flowLoops in flow
Loops in flow
 
EMAAR Vida Residences - Dubai Marina +971 4553 8725
EMAAR Vida Residences - Dubai Marina +971 4553 8725EMAAR Vida Residences - Dubai Marina +971 4553 8725
EMAAR Vida Residences - Dubai Marina +971 4553 8725
 
Corneal degenerations
Corneal degenerationsCorneal degenerations
Corneal degenerations
 
Présentation de Zabbix - Zabbix Toulouse #1 - ZUG
Présentation de Zabbix - Zabbix Toulouse #1 - ZUGPrésentation de Zabbix - Zabbix Toulouse #1 - ZUG
Présentation de Zabbix - Zabbix Toulouse #1 - ZUG
 
Ciclomobilidade e o PDDU de Salvador
Ciclomobilidade e o PDDU de SalvadorCiclomobilidade e o PDDU de Salvador
Ciclomobilidade e o PDDU de Salvador
 
Cardiología 2 sistema de conducción cardíaca
Cardiología 2  sistema de conducción cardíacaCardiología 2  sistema de conducción cardíaca
Cardiología 2 sistema de conducción cardíaca
 
Informe padres y alumnos 2017
Informe padres y alumnos 2017Informe padres y alumnos 2017
Informe padres y alumnos 2017
 
Photoshop
PhotoshopPhotoshop
Photoshop
 

Ähnlich wie Git ongithub

Git single branch
Git single branchGit single branch
Git single branchCarl Brown
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubScott Graham
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersDeepikaRana30
 
Nyc Code Camp 2010 Git And Github
Nyc Code Camp 2010 Git And GithubNyc Code Camp 2010 Git And Github
Nyc Code Camp 2010 Git And Githubjptoto
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Practical git for developers
Practical git for developersPractical git for developers
Practical git for developersWim Godden
 
GIT: a Gentle InTroduction
GIT: a Gentle InTroductionGIT: a Gentle InTroduction
GIT: a Gentle InTroductionCodemotion
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The ServerWildan Maulana
 

Ähnlich wie Git ongithub (20)

Git single branch
Git single branchGit single branch
Git single branch
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginners
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git and git hub basics
Git and git hub basicsGit and git hub basics
Git and git hub basics
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Nyc Code Camp 2010 Git And Github
Nyc Code Camp 2010 Git And GithubNyc Code Camp 2010 Git And Github
Nyc Code Camp 2010 Git And Github
 
Git Hub Platform
Git Hub PlatformGit Hub Platform
Git Hub Platform
 
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
 
Git presentation
Git presentationGit presentation
Git presentation
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Practical git for developers
Practical git for developersPractical git for developers
Practical git for developers
 
GIT: a Gentle InTroduction
GIT: a Gentle InTroductionGIT: a Gentle InTroduction
GIT: a Gentle InTroduction
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Git
GitGit
Git
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The Server
 

Kürzlich hochgeladen

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Kürzlich hochgeladen (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Git ongithub

  • 2. From an alumnus (2010)  You know, the more time I spent in industry the better I've understood what a strong advocate you are for the students in the IT program. You genuinely want to see us succeed in our careers, above all else.
  • 4. GitHub  Largest open source git hosting site  Public and private options  CS collaboration policy: your homework must be stored in a private repository.  https://education.github.com/  User-centric rather than project-centric  Try it  Log onto github  Walk through the tutorials
  • 5. How do I use github?  Set up a user account  public account is free, students can request 5 private  e.g. CyndiRader  Remember your password!  Create a repository  e.g. GitDemoCode  Add github as a “remote”  Push your master branch (later we’ll deal with other branches, just work with master for now)  Add collaborators (if public, everyone can read, but not write. If private, must be collaborator to even read) http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
  • 6. Typical workflow Person A Setup project & repo push code onto github edit/commit edit/commit pull/push Person B clone code from github edit/commit/push edit… edit… commit pull/push This is just the flow, specific commands on following slides. It’s also possible to create your project first on github, then clone (i.e., no git init)
  • 7. Remote repository  Remote repository is a bare repository  There is no working directory  Four transfer protocols  http – this is what I recommend/use  local (not covered – good for shared filesystems)  git (not covered – fast but more setup)  SSH (supplementary material at end of slides, not covered)
  • 8. Smart http  Added to git in v. 1.6.6  Read about it:  http://git-scm.com/2010/03/04/smart-http.html  Use it on the client: git clone https://github.com/CyndiRader/JavaDemos.git protocol userID repository When you create a repo on github, it will show you the HTTPS clone URL Avoid typos: a) copy the URL, b) in git bash, click git-icon/edit/paste OR press Insert.
  • 9. Create the repo – Option 1  Log onto github  Click on + to add repository  Enter name  Add .gitignore, good to have a README  Click on Settings to control access (Collaborators tab)  On PC, do git clone
  • 10. Create the repo – Option 2  Create your Java Project  Create your local repo  git init  git commit –m “Initial commit”  Create a repo on github  Add a “shortname” for your git repository  git remote add [shortname] [url]  git remote add origin https://github.com:[user name]/[repository name].git  Ex: git remote add origin https://github.com:CyndiRader/JavaDemos.git  Remember: You can copy/paste the repo url from github  Push your code onto github  git push –u [remote-name] [branch-name].  Ex: git push –u origin master – enter username/password
  • 11. Collaborating via github - cloning  git clone adds the remote repository under the name origin  git clone https://github.com:[user name]/[repository name].git  git clone https://github.com:CyndiRader/JavaDemos.git
  • 12. Example  Assume I have a repo named GUI2.git  In Eclipse: (from the directory where the clone was run): File -> New JavaProject -> GUI2
  • 13. Push example  Make a change to one of the files  See status (I already made one commit)
  • 14. Push example continued  Commit changes – updates local repo
  • 16. Keep everyone in synch  Be very careful not to make conflicting changes!  Merge with conflicts covered later  Two options for synchronizing:  Fetch/merge  Pull  Pull is usually simpler, but we’ll cover both.
  • 17. Fetch example - On original machine  Fetch, merge fast-forward covered under branching
  • 18. Pull example – on original machine  If you’re careful to avoid conflicts, and you’re working on the master branch, easier to just pull.  Make some changes on original machine  Don’t forget to commit! (see push below, didn’t work)
  • 19. Pull continued  Note typo. git merge origin/master BUT git push origin master.  Merge is specifying the branch to merge (in this case master branch on remote named origin - branches covered in detail later).  Push is specifying the remote and the local branch. typo
  • 20. Pull continued – on clone machine  git pull origin master  git pull (assumes origin, master)
  • 22. SSH  Used to be most common transport for git  Pros  Allows reads and writes  Authenticated network protocol  Secure: data transfer is encrypted and authenticated  Efficient: makes data as compact as possible  Cons  No anonymous read-only access
  • 23. Sidebar: What is SSH?  SSH is a protocol used for secure network communication Getting files from github • Generate public/private keys (ssh-keygen) • Distribute public keys (add key to github) • Someone (github) sends secure “message” (files) – they encode with public key • You receive the message/files – decode with private key (only you know) Putting files on github • Process is reversed to send files to github • You have the github public key (see github_rsa.pub, in Documents and Settings/Cyndi/.ssh on my machine) • Use it to encode when sending • github uses their private key to decode