SlideShare a Scribd company logo
git and github
darren oakley
disclaimer
โ€ข i use git daily in my work and manage to
  not have many problems
โ€ข iโ€™ve been asked to share the basics i know
  with others
โ€ข i am not a git expert - i may (most
  probably) not be able to answer all of your
  questions
what weโ€™ll cover

โ€ข brief discussion on version control
    - โ€˜traditionalโ€™ vโ€™s distributed
โ€ข git - the basics
โ€ข github - the basics
what we wonโ€™t cover

โ€ข advanced git
 โ€ข rebase
 โ€ข sub-modules
โ€ข git-svn
version control
version control

โ€ข what most people are (probably) used to:
 โ€ข concurrent version system (cvs)
 โ€ข subversion (svn)
version control

โ€ข cvs and svn
 โ€ข central source control server
 โ€ข users check code into server
 โ€ข requires connection to the server to
    perform commits, updates etc.
distributed version
       control
โ€ข the new hotness...
 โ€ข git
 โ€ข mercurial (hg)
 โ€ข bazaar (bzr)
whatโ€™s the difference?
โ€ข not a lot really...
 โ€ข you store a complete copy of a
    repository within your working copy
   โ€ข this means you can work of๏ฌ‚ine
 โ€ข there is no default โ€˜centralโ€™ server - if you
    want one, you (and your team) just
    nominate where it is (i.e. a github)
git
getting started

โ€ข move to a directory with code youโ€™d like to
  manage with git:
 git init

โ€ข youโ€™ve now created your ๏ฌrst git
  repository!
normal workflow
local operations
working                  staging              git directory
directory                 area                (repsoitory)



                   checkout the project



            stage ๏ฌles



                                     commit
staging files
  git add [filenames]



โ€ข add all changed ๏ฌles to the staging area:
  git add .



โ€ข these changes are NOT committed yet
the git staging area

โ€ข git has a concept of a โ€˜staging areaโ€™
 โ€ข you ๏ฌrst stage all of the changes that you
    are happy with
  โ€ข then you commit them
isnโ€™t this more work?

โ€ข in short - yes
 โ€ข but it allows you to craft the exact
    commit you want - you eventually get to
    love this feature
โ€ข you can get around it if you like...
committing

git commit -m โ€œcommit messageโ€


git commit -a -m โ€œcommit messageโ€
branching / merging
branching

git branch
git branch [new branch name]
git checkout [new branch name]
merging

git checkout [target branch]
git merge [other branch]
git merge --squash [other branch]
rewriting history

  git rebase



โ€ข will leave that as an exercise for you to
  investigate...
remote operations
remote repositories


git push [repository] [repository branch]



git pull [repository] [repository branch]
remote operations
                                                                   user
                               repository
                                (github)

user one                                                       user



                                                      user
           repository
            (internal)


                         example - group using open source code internally with
                         modi๏ฌcations speci๏ฌc to them can easily push/pull from
user two
                         the project โ€˜masterโ€™
some rules i tend
to follow...
โ€ข NEVER pull when you have
  uncommitted changes - commit your
  work ๏ฌrst

โ€ข if working on a feature, use a local
  branch, then this leaves the master
  open for other ๏ฌxes

โ€ข NEVER rebase or amend commits
  that you have pushed
If you want it to work
     like cvs / svn
โ€ข simply...
 โ€ข โ€˜pullโ€™ at the start of the day and at regular
    intervals (as often as youโ€™d checkout your
    code in cvs/svn)
  โ€ข โ€˜pushโ€™ after every commit
github
github

โ€ข http://github.com
โ€ข popular git repository hosting site
โ€ข home to many open source projects:
 โ€ข ruby on rails, jquery to name two...
a quick hands-on
with github
the plan...

โ€ข get yourselves into pairs
โ€ข person 1:
 โ€ข create a repository
 โ€ข check in some code
 โ€ข add person 2 to project
the plan...
โ€ข person 2:
 โ€ข pull code from person 1โ€™s repository
 โ€ข make some changes and push back to
    repository
โ€ข person 1:
 โ€ข pull these changes
the plan...

โ€ข somebody:
 โ€ข tag a release of the code
 โ€ข push this tag to github
 โ€ข stare in awe at the auto-generated tarball
if we have time...

โ€ข person 1:
 โ€ข create a local branch of the code
 โ€ข push this branch to github
โ€ข person 2:
 โ€ข pull and work with this remote branch
if we have more time


โ€ข simulate a con๏ฌ‚ict and resolve it
letโ€™s get going...
person 1
git and github
git and github
git and github
git and github
git and github
person 2
git and github
git clone [paste โ€˜your clone urlโ€™]

edit something

add and commit
git push origin master
person 1
git pull origin master

see if you have the changes from your
partner
somebody
git tag rel_1.0

git push --tags
git and github
git and github
do we have time?
person 1
git branch new_feature_foo

git checkout new_feature_foo

edit something, add and commit
git push origin new_feature_foo
person 2
git remote show origin


git fetch origin new_feature_foo:new_feature_foo




git fetch [repo] [remote_branch]:[local_branch]
edit something, add and commit
git push origin new_feature_foo

cat .git/config
 - info on repository setup
git and github
simulating a conflict
person 1
without doing a git pull!

edit the ๏ฌle that person 2 just edited

save, add and commit changes
git push origin new_feature_foo

O_o ooops...
git pull origin new_feature_foo

(git will inform you of a con๏ฌ‚ict)

edit the ๏ฌle - resolve the con๏ฌ‚ict

git add, commit, push

con๏ฌ‚ict resolved! ^_^
further reading

โ€ข http://git-scm.com/documentation
โ€ข http://learn.github.com/
โ€ข http://help.github.com/
โ€ข http://www.gitready.com/
further reading
git config
some setup i find useful...
git config --global color.diff auto


git config --global color.status auto


git config --global color.branch auto


git config --global color.interactive auto
git config --global alias.st status


git config --global alias.ci commit


git config --global alias.co checkout


git config --global alias.br branch
git config --global core.excludesfile ~/.gitignore


echo "*~" >~/.gitignore


echo ".DS_Store" >>~/.gitignore
Ad

More Related Content

What's hot (20)

Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
ย 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
ย 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
James Gray
ย 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
ย 
Learning git
Learning gitLearning git
Learning git
Sid Anand
ย 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
ย 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
ย 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolรกs Tournรฉ
ย 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
ย 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
ย 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
ย 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
SheilaJimenezMorejon
ย 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
Krunal Doshi
ย 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
Yoad Snapir
ย 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
ย 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
ย 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
ย 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
ย 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
ย 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
GoogleDevelopersStud1
ย 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
ย 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
James Gray
ย 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
ย 
Learning git
Learning gitLearning git
Learning git
Sid Anand
ย 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
ย 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
ย 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
ย 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
Krunal Doshi
ย 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
Yoad Snapir
ย 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
ย 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
ย 

Similar to git and github (20)

Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
ย 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
ย 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
ย 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
ย 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
ย 
Git-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptxGit-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptx
vietnguyen1989
ย 
Git-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptxGit-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptx
vietnguyen1989
ย 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
ย 
391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
ย 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
ย 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
ย 
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
ย 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
ย 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Fundamentals and basics of Git and commands
Fundamentals and basics of Git and commandsFundamentals and basics of Git and commands
Fundamentals and basics of Git and commands
DivyanshGupta922023
ย 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
ย 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
ย 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
ย 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
ย 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
ย 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
ย 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
ย 
Git-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptxGit-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptx
vietnguyen1989
ย 
Git-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptxGit-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptx
vietnguyen1989
ย 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
ย 
391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
ย 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
ย 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
ย 
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
ย 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
ย 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
ย 
Fundamentals and basics of Git and commands
Fundamentals and basics of Git and commandsFundamentals and basics of Git and commands
Fundamentals and basics of Git and commands
DivyanshGupta922023
ย 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
ย 
Ad

Recently uploaded (20)

Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
ย 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
ย 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
ย 
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy ConsumptionDrupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Exove
ย 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Asthma presentaciรณn en inglรฉs abril 2025 pdf
Asthma presentaciรณn en inglรฉs abril 2025 pdfAsthma presentaciรณn en inglรฉs abril 2025 pdf
Asthma presentaciรณn en inglรฉs abril 2025 pdf
VanessaRaudez
ย 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
ย 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
ย 
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
ย 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
ย 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
ย 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
ย 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
ย 
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy ConsumptionDrupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Exove
ย 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Asthma presentaciรณn en inglรฉs abril 2025 pdf
Asthma presentaciรณn en inglรฉs abril 2025 pdfAsthma presentaciรณn en inglรฉs abril 2025 pdf
Asthma presentaciรณn en inglรฉs abril 2025 pdf
VanessaRaudez
ย 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
ย 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
ย 
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
ย 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
ย 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
Ad

git and github

  • 2. disclaimer โ€ข i use git daily in my work and manage to not have many problems โ€ข iโ€™ve been asked to share the basics i know with others โ€ข i am not a git expert - i may (most probably) not be able to answer all of your questions
  • 3. what weโ€™ll cover โ€ข brief discussion on version control - โ€˜traditionalโ€™ vโ€™s distributed โ€ข git - the basics โ€ข github - the basics
  • 4. what we wonโ€™t cover โ€ข advanced git โ€ข rebase โ€ข sub-modules โ€ข git-svn
  • 6. version control โ€ข what most people are (probably) used to: โ€ข concurrent version system (cvs) โ€ข subversion (svn)
  • 7. version control โ€ข cvs and svn โ€ข central source control server โ€ข users check code into server โ€ข requires connection to the server to perform commits, updates etc.
  • 8. distributed version control โ€ข the new hotness... โ€ข git โ€ข mercurial (hg) โ€ข bazaar (bzr)
  • 9. whatโ€™s the difference? โ€ข not a lot really... โ€ข you store a complete copy of a repository within your working copy โ€ข this means you can work of๏ฌ‚ine โ€ข there is no default โ€˜centralโ€™ server - if you want one, you (and your team) just nominate where it is (i.e. a github)
  • 10. git
  • 11. getting started โ€ข move to a directory with code youโ€™d like to manage with git: git init โ€ข youโ€™ve now created your ๏ฌrst git repository!
  • 13. local operations working staging git directory directory area (repsoitory) checkout the project stage ๏ฌles commit
  • 14. staging files git add [filenames] โ€ข add all changed ๏ฌles to the staging area: git add . โ€ข these changes are NOT committed yet
  • 15. the git staging area โ€ข git has a concept of a โ€˜staging areaโ€™ โ€ข you ๏ฌrst stage all of the changes that you are happy with โ€ข then you commit them
  • 16. isnโ€™t this more work? โ€ข in short - yes โ€ข but it allows you to craft the exact commit you want - you eventually get to love this feature โ€ข you can get around it if you like...
  • 17. committing git commit -m โ€œcommit messageโ€ git commit -a -m โ€œcommit messageโ€
  • 19. branching git branch git branch [new branch name] git checkout [new branch name]
  • 20. merging git checkout [target branch] git merge [other branch] git merge --squash [other branch]
  • 21. rewriting history git rebase โ€ข will leave that as an exercise for you to investigate...
  • 23. remote repositories git push [repository] [repository branch] git pull [repository] [repository branch]
  • 24. remote operations user repository (github) user one user user repository (internal) example - group using open source code internally with modi๏ฌcations speci๏ฌc to them can easily push/pull from user two the project โ€˜masterโ€™
  • 25. some rules i tend to follow...
  • 26. โ€ข NEVER pull when you have uncommitted changes - commit your work ๏ฌrst โ€ข if working on a feature, use a local branch, then this leaves the master open for other ๏ฌxes โ€ข NEVER rebase or amend commits that you have pushed
  • 27. If you want it to work like cvs / svn โ€ข simply... โ€ข โ€˜pullโ€™ at the start of the day and at regular intervals (as often as youโ€™d checkout your code in cvs/svn) โ€ข โ€˜pushโ€™ after every commit
  • 29. github โ€ข http://github.com โ€ข popular git repository hosting site โ€ข home to many open source projects: โ€ข ruby on rails, jquery to name two...
  • 31. the plan... โ€ข get yourselves into pairs โ€ข person 1: โ€ข create a repository โ€ข check in some code โ€ข add person 2 to project
  • 32. the plan... โ€ข person 2: โ€ข pull code from person 1โ€™s repository โ€ข make some changes and push back to repository โ€ข person 1: โ€ข pull these changes
  • 33. the plan... โ€ข somebody: โ€ข tag a release of the code โ€ข push this tag to github โ€ข stare in awe at the auto-generated tarball
  • 34. if we have time... โ€ข person 1: โ€ข create a local branch of the code โ€ข push this branch to github โ€ข person 2: โ€ข pull and work with this remote branch
  • 35. if we have more time โ€ข simulate a con๏ฌ‚ict and resolve it
  • 45. git clone [paste โ€˜your clone urlโ€™] edit something add and commit git push origin master
  • 47. git pull origin master see if you have the changes from your partner
  • 49. git tag rel_1.0 git push --tags
  • 52. do we have time?
  • 54. git branch new_feature_foo git checkout new_feature_foo edit something, add and commit git push origin new_feature_foo
  • 56. git remote show origin git fetch origin new_feature_foo:new_feature_foo git fetch [repo] [remote_branch]:[local_branch]
  • 57. edit something, add and commit git push origin new_feature_foo cat .git/config - info on repository setup
  • 61. without doing a git pull! edit the ๏ฌle that person 2 just edited save, add and commit changes git push origin new_feature_foo O_o ooops...
  • 62. git pull origin new_feature_foo (git will inform you of a con๏ฌ‚ict) edit the ๏ฌle - resolve the con๏ฌ‚ict git add, commit, push con๏ฌ‚ict resolved! ^_^
  • 63. further reading โ€ข http://git-scm.com/documentation โ€ข http://learn.github.com/ โ€ข http://help.github.com/ โ€ข http://www.gitready.com/
  • 65. git config some setup i find useful...
  • 66. git config --global color.diff auto git config --global color.status auto git config --global color.branch auto git config --global color.interactive auto
  • 67. git config --global alias.st status git config --global alias.ci commit git config --global alias.co checkout git config --global alias.br branch
  • 68. git config --global core.excludesfile ~/.gitignore echo "*~" >~/.gitignore echo ".DS_Store" >>~/.gitignore