SlideShare uma empresa Scribd logo
1 de 35
GITHUB
& A BIT ON WORKFLOW
Thursday, 30 May 13
WHAT IS SCM?
SOURCE CODE MANAGEMENT
• Storing versions of files
• Good backup
• Important when working in teams
• Points to revert back to
Thursday, 30 May 13
SCM SYSTEMS
SOME EXAMPLES
• Mercurial
SUPER QUICK, LARGE DEV-TEAMS, SIMPLE
• Subversion
WIDEST ADOPTION, CHECKING OUT FILES, CENTRAL SERVER
• Git
GROWING QUICKLY, SUPER FAST, DELTA CHANGES, GITHUB, AWESOME
Thursday, 30 May 13
GIT VS GITHUB
• Distributed source code management
system
• Hosted solution to facilitate easy
collaboration on Git repositories
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Server-less
• Personal preference
• GitHub
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Personal preference
• GitHub
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Personal preference
• GitHub
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Personal preference
• GitHub
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Personal preference
• GitHub
Thursday, 30 May 13
WHY GIT?
• Distributed
• Super-fast
• Lightweight
• Personal preference
• GitHub
Thursday, 30 May 13
GITHUB, GITHUB, GITHUB
MORE ON THIS MAGICAL TOOL
• Git repository hosting
• Web tool suite
• Collaborative development
• Social coding (forking)
Thursday, 30 May 13
INSTALLING GIT
HANDS-ON #1
MAC
<3 - Easy as pie
WINDOWS
Good luck
https://help.github.com/articles/set-up-git
Thanks GitHub, let’s visit:
Thursday, 30 May 13
GIT WORKFLOW
$ cd ~/Desktop/
$ mkdir git
cd is the unix command for
‘change directory’. ~/ is
your home directory.
mkdir is the unix command
for ‘make directory’. The
same thing as creating a
new folder.
Thursday, 30 May 13
GIT WORKFLOW
git init will turn the current
folder into a git repository.
Git will now monitor this
folder and any files and
sub-directories for changes
$ cd ~/Desktop/
$ mkdir git
$ cd git
$ git init
Thursday, 30 May 13
GIT WORKFLOW
git status tells you the
current status of the
repository (changed files
etc)
Now: open up your text
editor and create a blank
txt file. Save it in the same
directory as your git repo.
$ git init
$ git status
Thursday, 30 May 13
GIT WORKFLOW
git status will now tell you
there are untracked files
git add [filename] is used to
add files to the stage for a
commit
$ git status
$ git add hello.txt
Thursday, 30 May 13
WOAH, SLOW DOWN!
SOME GIT TERMINOLOGY
STAGE
A SET OF “STAGED” CHANGES THAT WILL BE PART OF A
COMMIT
COMMIT
A PERMANENT SNAPSHOT OFYOUR GIT REPOSITORY AT A
GIVEN TIME
Thursday, 30 May 13
GIT WORKFLOW
git commit will create a
snapshot of your repository
saving all staged changes
We use the -m flag
followed by a string to
define a commit message.
Keep in mind that unstaged
changes won’t be saved.
$ git status
$ git add hello.txt
$ git commit -m “Initial commit”
Thursday, 30 May 13
GIT WORKFLOW
git status will show no
changes
1. Make a change to
hello.txt
2. Make a new file
3. Commit JUST the new
file
$ git status
$ git add hello.txt
$ git commit -m “Initial commit”
$ git status
Thursday, 30 May 13
HOLD UP!
What do you notice?
Thursday, 30 May 13
TEAM WORKFLOW
USING GIT & GITHUB
• Role-oriented AND random editing of files
without fear of overwriting anyone else’s work
• Branching off from the master (main) code base to
work on individual features WITHOUT breaking
the whole site
• Multiple backups of the code-base
• Ability to revert to ANY previous version of a file
Thursday, 30 May 13
‘ADVANCED’ TERMINOLOGY
PUSHING
PUSHYOUR COMMITS TO THE UPSTREAM SERVER (GITHUB)
PULLING
PULL DOWN THE LATEST COMMITS FROM THE UPSTREAM SERVER (GITHUB)
MASTER BRANCH
MASTER IS THE DEFAULT BRANCH INYOUR REPOSITORY.THIS IS THE MAIN CODE BASE
AND SHOULD AT ALL TIMES CONTAIN DEPLOYABLE CODE.
BRANCHING
CREATING ADDITIONAL BRANCHES OFF OF MASTER TO WORK ON INDIVIDUAL FEATURES
Thursday, 30 May 13
PUSHING & PULLING
USING AN UPSTREAM SERVER (GITHUB)
• In your teams: push and pull as often as
possible
• Before starting work on, always PULL
• Try to use another communication tool (FB,
Skype etc) to keep in touch when developing
and tell eachother when you have made
changes.
Thursday, 30 May 13
OH SHIT!
SOMEONE EFFED’ UP
•You probably went to push some commits
without pulling from GitHub and now you have
some screwed up, out of order repo.
•Solving this problem can be a bitch so cross
your fingers and hope for the best.
Thursday, 30 May 13
OH SHIT!
THE SOLUTION
• Run git pull. Git will force you to merge
the changes but you will need to do this
manually.
• Run git merge. Git will merge your
commits with the upstream commits into
a new commit, then push.
Thursday, 30 May 13
BRANCHING
SOME GIT AWESOMENESS
• Branching should be used when you want to
work on a specific feature
• Give your branches descriptive names
i.e. user-login or pretty-forms
• Don’t try and make your branches all
encompassing (keep them small and modular)
Thursday, 30 May 13
USING GITHUB
HANDS-ON #2
http://github.com
Go to ^ and make an account
Thursday, 30 May 13
TEAM WORKFLOW
BRANCHING, PULL REQUESTS & MERGING
• Get in your teams
• The technical lead should create a repository on
their account then go to settings and invite the
other members of your team as collaborators.
• Everybody grab the URL found on the repo page:
Thursday, 30 May 13
BRANCHING
$ cd ~/Desktop/
$ git clone https://github.com/
codycarnachan/mds.git
Let’s reset our directory to
our Desktop.
git clone is the command
for cloning a repository.
Make sure you put your
own URL in; you won’t be
able to clone repositories
that you aren’t a
collaborator on.
Thursday, 30 May 13
BRANCHING
$ cd ~/Desktop/
$ git clone https://github.com/
codycarnachan/mds.git
$ git checkout -b new-branch-
name
git checkout -b
[branchname] is the
command for creating a
new branch and switching
to it (or just switching if it
already exists)
Changes you make now will
be independent to the
master brach
Thursday, 30 May 13
BRANCHING
$ cd ~/Desktop/
$ git clone https://github.com/
codycarnachan/mds.git
$ git checkout -b new-branch-
name
Create a file with some
text and then commit it.
Note: There is a different
format to push your new
local branch to the
upstream server:
git push -u origin
[branchname]
Thursday, 30 May 13
TEAM WORKFLOW
BRANCHING, PULL REQUESTS & MERGING
• You can checkout each others branches to test
features that might be in progress.
• Once you have a branch with code that is ready to
get merged into master. Go to the GitHub page >
Branches > Click on the branch and then Click Pull
Request
• The Technical Lead should be responsible for
merging pull requests to keep everything streamlined.
Thursday, 30 May 13
RECAP
• git init
• git clone
• git add
• git commit
• git push
• git pull
• git status
• git merge
• git checkout
• pull requests
Thursday, 30 May 13
FURTHER READING
• A general guide to pushing/pulling
http://tinyurl.com/c3yr2v
• What to do when master is ahead of you
http://tinyurl.com/nh9jt2t
• Basic overview of branching and merging
http://tinyurl.com/btwgu79
• Setting up Git at home
https://help.github.com/articles/set-up-git
Thursday, 30 May 13
THE END!
ANY QUESTIONS? HIT ME UP
Thursday, 30 May 13

Mais conteúdo relacionado

Mais procurados

Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for BeginnersRick Umali
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Building a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPBuilding a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPRobert MacLean
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil AliAmilAli1
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Omar Fathy
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubRick Umali
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewRueful Robin
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash courseMireia Sangalo
 
Git & GitHub
Git & GitHubGit & GitHub
Git & GitHubCuong Ngo
 

Mais procurados (20)

Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
A prentation on github
A prentation on githubA prentation on github
A prentation on github
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for Beginners
 
Git
GitGit
Git
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Building a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPBuilding a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCP
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil Ali
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Github basics
Github basicsGithub basics
Github basics
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
 
Git & GitHub
Git & GitHubGit & GitHub
Git & GitHub
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 

Destaque

The development workflow of git github for beginners
The development workflow of git github for beginnersThe development workflow of git github for beginners
The development workflow of git github for beginnersGunjan Patel
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with GitIvano Malavolta
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubJames Gray
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for DocumentationAnne Gentle
 
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
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...Oleg Shalygin
 

Destaque (9)

The development workflow of git github for beginners
The development workflow of git github for beginnersThe development workflow of git github for beginners
The development workflow of git github for beginners
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
My Git workflow
My Git workflowMy Git workflow
My Git workflow
 
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
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 

Semelhante a GitHub Talk - Cody Carnachan

Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone useIkuru Kanuma
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Celestine Omin
 
Git with the flow
Git with the flowGit with the flow
Git with the flowDana White
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubDSC GVP
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 
Git in gear: How to track changes, travel back in time, and code nicely with ...
Git in gear: How to track changes, travel back in time, and code nicely with ...Git in gear: How to track changes, travel back in time, and code nicely with ...
Git in gear: How to track changes, travel back in time, and code nicely with ...fureigh
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How tolanhuonga3
 

Semelhante a GitHub Talk - Cody Carnachan (20)

Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
3 Git
3 Git3 Git
3 Git
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone use
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Git github
Git githubGit github
Git github
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
GDSC Git event 2023.pptx
GDSC Git event 2023.pptxGDSC Git event 2023.pptx
GDSC Git event 2023.pptx
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Git in gear: How to track changes, travel back in time, and code nicely with ...
Git in gear: How to track changes, travel back in time, and code nicely with ...Git in gear: How to track changes, travel back in time, and code nicely with ...
Git in gear: How to track changes, travel back in time, and code nicely with ...
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 

Último

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

GitHub Talk - Cody Carnachan

  • 1. GITHUB & A BIT ON WORKFLOW Thursday, 30 May 13
  • 2. WHAT IS SCM? SOURCE CODE MANAGEMENT • Storing versions of files • Good backup • Important when working in teams • Points to revert back to Thursday, 30 May 13
  • 3. SCM SYSTEMS SOME EXAMPLES • Mercurial SUPER QUICK, LARGE DEV-TEAMS, SIMPLE • Subversion WIDEST ADOPTION, CHECKING OUT FILES, CENTRAL SERVER • Git GROWING QUICKLY, SUPER FAST, DELTA CHANGES, GITHUB, AWESOME Thursday, 30 May 13
  • 4. GIT VS GITHUB • Distributed source code management system • Hosted solution to facilitate easy collaboration on Git repositories Thursday, 30 May 13
  • 5. WHY GIT? • Distributed • Super-fast • Lightweight • Server-less • Personal preference • GitHub Thursday, 30 May 13
  • 6. WHY GIT? • Distributed • Super-fast • Lightweight • Personal preference • GitHub Thursday, 30 May 13
  • 7. WHY GIT? • Distributed • Super-fast • Lightweight • Personal preference • GitHub Thursday, 30 May 13
  • 8. WHY GIT? • Distributed • Super-fast • Lightweight • Personal preference • GitHub Thursday, 30 May 13
  • 9. WHY GIT? • Distributed • Super-fast • Lightweight • Personal preference • GitHub Thursday, 30 May 13
  • 10. WHY GIT? • Distributed • Super-fast • Lightweight • Personal preference • GitHub Thursday, 30 May 13
  • 11. GITHUB, GITHUB, GITHUB MORE ON THIS MAGICAL TOOL • Git repository hosting • Web tool suite • Collaborative development • Social coding (forking) Thursday, 30 May 13
  • 12. INSTALLING GIT HANDS-ON #1 MAC <3 - Easy as pie WINDOWS Good luck https://help.github.com/articles/set-up-git Thanks GitHub, let’s visit: Thursday, 30 May 13
  • 13. GIT WORKFLOW $ cd ~/Desktop/ $ mkdir git cd is the unix command for ‘change directory’. ~/ is your home directory. mkdir is the unix command for ‘make directory’. The same thing as creating a new folder. Thursday, 30 May 13
  • 14. GIT WORKFLOW git init will turn the current folder into a git repository. Git will now monitor this folder and any files and sub-directories for changes $ cd ~/Desktop/ $ mkdir git $ cd git $ git init Thursday, 30 May 13
  • 15. GIT WORKFLOW git status tells you the current status of the repository (changed files etc) Now: open up your text editor and create a blank txt file. Save it in the same directory as your git repo. $ git init $ git status Thursday, 30 May 13
  • 16. GIT WORKFLOW git status will now tell you there are untracked files git add [filename] is used to add files to the stage for a commit $ git status $ git add hello.txt Thursday, 30 May 13
  • 17. WOAH, SLOW DOWN! SOME GIT TERMINOLOGY STAGE A SET OF “STAGED” CHANGES THAT WILL BE PART OF A COMMIT COMMIT A PERMANENT SNAPSHOT OFYOUR GIT REPOSITORY AT A GIVEN TIME Thursday, 30 May 13
  • 18. GIT WORKFLOW git commit will create a snapshot of your repository saving all staged changes We use the -m flag followed by a string to define a commit message. Keep in mind that unstaged changes won’t be saved. $ git status $ git add hello.txt $ git commit -m “Initial commit” Thursday, 30 May 13
  • 19. GIT WORKFLOW git status will show no changes 1. Make a change to hello.txt 2. Make a new file 3. Commit JUST the new file $ git status $ git add hello.txt $ git commit -m “Initial commit” $ git status Thursday, 30 May 13
  • 20. HOLD UP! What do you notice? Thursday, 30 May 13
  • 21. TEAM WORKFLOW USING GIT & GITHUB • Role-oriented AND random editing of files without fear of overwriting anyone else’s work • Branching off from the master (main) code base to work on individual features WITHOUT breaking the whole site • Multiple backups of the code-base • Ability to revert to ANY previous version of a file Thursday, 30 May 13
  • 22. ‘ADVANCED’ TERMINOLOGY PUSHING PUSHYOUR COMMITS TO THE UPSTREAM SERVER (GITHUB) PULLING PULL DOWN THE LATEST COMMITS FROM THE UPSTREAM SERVER (GITHUB) MASTER BRANCH MASTER IS THE DEFAULT BRANCH INYOUR REPOSITORY.THIS IS THE MAIN CODE BASE AND SHOULD AT ALL TIMES CONTAIN DEPLOYABLE CODE. BRANCHING CREATING ADDITIONAL BRANCHES OFF OF MASTER TO WORK ON INDIVIDUAL FEATURES Thursday, 30 May 13
  • 23. PUSHING & PULLING USING AN UPSTREAM SERVER (GITHUB) • In your teams: push and pull as often as possible • Before starting work on, always PULL • Try to use another communication tool (FB, Skype etc) to keep in touch when developing and tell eachother when you have made changes. Thursday, 30 May 13
  • 24. OH SHIT! SOMEONE EFFED’ UP •You probably went to push some commits without pulling from GitHub and now you have some screwed up, out of order repo. •Solving this problem can be a bitch so cross your fingers and hope for the best. Thursday, 30 May 13
  • 25. OH SHIT! THE SOLUTION • Run git pull. Git will force you to merge the changes but you will need to do this manually. • Run git merge. Git will merge your commits with the upstream commits into a new commit, then push. Thursday, 30 May 13
  • 26. BRANCHING SOME GIT AWESOMENESS • Branching should be used when you want to work on a specific feature • Give your branches descriptive names i.e. user-login or pretty-forms • Don’t try and make your branches all encompassing (keep them small and modular) Thursday, 30 May 13
  • 27. USING GITHUB HANDS-ON #2 http://github.com Go to ^ and make an account Thursday, 30 May 13
  • 28. TEAM WORKFLOW BRANCHING, PULL REQUESTS & MERGING • Get in your teams • The technical lead should create a repository on their account then go to settings and invite the other members of your team as collaborators. • Everybody grab the URL found on the repo page: Thursday, 30 May 13
  • 29. BRANCHING $ cd ~/Desktop/ $ git clone https://github.com/ codycarnachan/mds.git Let’s reset our directory to our Desktop. git clone is the command for cloning a repository. Make sure you put your own URL in; you won’t be able to clone repositories that you aren’t a collaborator on. Thursday, 30 May 13
  • 30. BRANCHING $ cd ~/Desktop/ $ git clone https://github.com/ codycarnachan/mds.git $ git checkout -b new-branch- name git checkout -b [branchname] is the command for creating a new branch and switching to it (or just switching if it already exists) Changes you make now will be independent to the master brach Thursday, 30 May 13
  • 31. BRANCHING $ cd ~/Desktop/ $ git clone https://github.com/ codycarnachan/mds.git $ git checkout -b new-branch- name Create a file with some text and then commit it. Note: There is a different format to push your new local branch to the upstream server: git push -u origin [branchname] Thursday, 30 May 13
  • 32. TEAM WORKFLOW BRANCHING, PULL REQUESTS & MERGING • You can checkout each others branches to test features that might be in progress. • Once you have a branch with code that is ready to get merged into master. Go to the GitHub page > Branches > Click on the branch and then Click Pull Request • The Technical Lead should be responsible for merging pull requests to keep everything streamlined. Thursday, 30 May 13
  • 33. RECAP • git init • git clone • git add • git commit • git push • git pull • git status • git merge • git checkout • pull requests Thursday, 30 May 13
  • 34. FURTHER READING • A general guide to pushing/pulling http://tinyurl.com/c3yr2v • What to do when master is ahead of you http://tinyurl.com/nh9jt2t • Basic overview of branching and merging http://tinyurl.com/btwgu79 • Setting up Git at home https://help.github.com/articles/set-up-git Thursday, 30 May 13
  • 35. THE END! ANY QUESTIONS? HIT ME UP Thursday, 30 May 13