SlideShare a Scribd company logo
1 of 51
Download to read offline
Workshop
Git and Github for beginners
(and something for advanced too)
Otto Kekäläinen
Startup.bg 6.11.2015
Sofia,Bulagaria
@ottokekalainen
●
15+ years in open source
●
technology & business & advocacy
●
development with git since 2010
The MariaDB Foundation
Continuity and open collaboration
●
MariaDB.org sponsors include MariaDB.com,Booking.com,
Automattic,Odin/Parallels,Visma...
●
Employs 6 persons,including ”Monty”Widenius,the creator of
MySQL/MariaDB
●
Single contact point for collaboration and contributions
●
The Foundation makes sure all pull requests and patches are
reviewed
●
All development work done with git at github.com/mariadb
Outline
1.The story of Git
2.Basic commands
3.Doing it with Github
4.Git internals
5.Advanced commands
6.Git everywhere?
1.Story of Git
Git / t/ɡɪ
”A silly,incompetent,stupid,
annoying or childish person.”
http://en.wiktionary.org/wiki/git
"I'm an egotistical bastard,so I
name all my projects after myself.
First Linux,now Git”
Linus Torvalds,PC World.2012-07-14
Linus needed a new source code revision manager for
Linux,and none of the available options in 2005 where
good enough,so he wrote his own in.
Kernel 2.6.12 was the first release managed by Git and
version 1.0 of Git was released in December 2005.
Design goals of Git:
●
distributed revision management
●
protection against corruption,
both accidental and hostile
●
speed
Git popularity according to OpenHub.net
Git popularity according to Google Trends
git
svn
...but adoption would be faster if it was
not so difficult to use.
Originally Linus did not intend end users to use Git
directly,instead he tried to delegate to somebody
else the task of making the actual command line
interface. We are still waiting for it...
Luckily Git has been simplified and documentation
has improved over time,but some Git commands
still refer to Git internals that are difficult to grasp.
E.g. git-push: Update remote refs along with
associated objects.
Git might feel difficult at first,
but once you learn it, you never
want to go back to anything less
flexible and powerful.
Install on Linux:
apt-get install git git-gui
Install on Mac/Windows:
git-scm.com/downloads
2.Basic commands
First obstacle: same terms with different meanings
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
Define the author of commits
git init
git add example.txt
git commit -am “First commit”
# edit files
git commit -am “Second commit”
Start a new repository
git pull
# edit files
git commit -am “Implemented X”
git push
git log
git show
Typical workflow
3.Doing it with Github
Visit http://try.github.com/
After making your first repository,set up SSH key
for convenient authentication:
https://help.github.com/articles/generating-ssh-keys
Note: Github is not the only Git hosting site,
Gitlab and Bitbucket are popular too.
Exercise:
-go to https://github.com/ottok/git-training and fork it
-look at the fork under your own Github account and
clone it to your laptop
-edit names.txt and add yours
-push changes back to Github
-in Github,do a merge request back to me
git clone git://github.com/<yourname>/git-training.git
# edit names.txt
git commit -am “Added my name”
git push
# Open pull request on Github
The best part of Github is pull
requests,and how they enable
frictionless collaboration among
millions of developers
4.Git internals
Folder /.git contains everything,
your / is just the working copy.
Folder /.git contains everything,
your / is just the working copy.
When you commit a 2 MB file /example.png,
your / will grow to 4 MB...
When you add a file,
it goes to the staging area.
The file does not go into the
actual history tree until the stage
is committed.
Commands push and pull and many other commands
are shortcuts that act with both
your local repository and the remote repositories.
Image credits Steve Bennet (http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/)
Git tracks content,not files!
Git history is immutable as each commit ID is the SHA-1 of
the commit data and metadata (including the commit ID of
parents).Changing any commit in the history will change the
SHA-1 commit IDs of every following commit in the chain.
If you need to change something in the history,you have to
rebase and make a new history.
Git commit IDs and rebase
Original 'git log --oneline':
1bf7024 MDEV-8991: bind-address appears twice in default my.cnf
b2205c5 MDEV-9011: Redo log encryption does not work
cf9e6b2 Fix test failures seen on buildbot.
923827e MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO
239e0c5 MDEV-8551 compilation fails with 10.1.6
After 'git rebase -i HEAD^^^':
34350b9 MDEV-8991: bind-address appears twice in default my.cnf
f5f2dd9 MDEV-9011: Redo log encryption does not work
531e1ac Fixed all bugs
923827e MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO
239e0c5 MDEV-8551 compilation fails with 10.1.6
Branches and tags
Basically just labels that point to certain commit IDs.
Each commit ID point to its parent,thus forms a chain.
How to write a good commit message
●
Your attitude towards commit messages should be the same as for code: it is
written once,but read thousands of times.
●
Don't explain how was done,that is visible in the diff anyway.Explain what the
intention was and why it was made.
●
Use imperative form “Fix typo”(instead of “Fixed typo”)
●
Keep subject line short and sweet,under 72 chars.Body can be verbose.
●
Use proper English.Capital letters.Reference issue identifiers is possible.
●
Looking for a good example? How about one by Linus himself?
https://github.com/torvalds/linux/commit/fc90888
5.Advanced commands
Sorry,but default commands not very friendly,so get
yourself good cheat cheets and write up your common
commands once you've figured them out..
Image credits Steve Bennet (http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/)
Example of how fast-forward works 1/2
●
Branch“feature-branch-example”forked from master branch
“10.1”and has 3 commits
Example of how fast-forward works 2/2
●
Normal merge defaults to fast-forward in this case
●
●
●
Result of no fast-forward (git merge --no-ff)
Want to avoid “ugly”merge commits?
●
git config pull.ff=only
●
git config alias.ff=merge --ff-only
●
Run 'git rebase master'to rebase you work on the master
branch before pushing or making pull request
●
Run 'git merge'on when importing changes from remote
head only if you really want to merge
Want to put a simple shared repository on any SSH
capable server? Create a bare .git with no working files:
git init --bare
Want to have notifications when somebody commits?
Put a shell script at .git/hooks/post-receive
6.Git everywhere?
Would you like to store all your files in Git?
Git-annex
Diff of binary files?
Add in .git/config
[diff"odf"]
textconv=odt2txt
See also: http://www-verimag.imag.fr/~moy/opendocument/
Bug tracker as part of project?
http://bugseverywhere.org/
Bug tracker and wiki contents in Git?
trac+git
Clone wiki from Github with
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.wiki.git
Publish to the web with one commit?
self-hosted Jekyll or
on Github https://pages.github.com/
Open source alternative to Dropbox based on Git?
http://sparkleshare.org/
Would you like others to
contribute to your software?
Provide easy forking (git clone),
easy way to develop new feature (git branch),
and an easy way to send them back (merge request).
Will Git credits replace developers CV's?
Is there anything we can't store and track in Git?
© 2015 MariaDB Foundation51
Thanks!
mariadb.org
@ottokekalainen
otto@mariadb.org

More Related Content

What's hot

Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stackAnne Nicolas
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?Michelle Holley
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernelVadim Nikitin
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
7 hands on
7 hands on7 hands on
7 hands onvideos
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver艾鍗科技
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)Brendan Gregg
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016Peter Lawrey
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingMichelle Holley
 
Monitoring of GPU Usage with Tensorflow Models Using Prometheus
Monitoring of GPU Usage with Tensorflow Models Using PrometheusMonitoring of GPU Usage with Tensorflow Models Using Prometheus
Monitoring of GPU Usage with Tensorflow Models Using PrometheusDatabricks
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMCLinaro
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and moreBrendan Gregg
 

What's hot (20)

Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernel
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git (実践入門編)
Git (実践入門編)Git (実践入門編)
Git (実践入門編)
 
Build Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratchBuild Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratch
 
7 hands on
7 hands on7 hands on
7 hands on
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
Monitoring of GPU Usage with Tensorflow Models Using Prometheus
Monitoring of GPU Usage with Tensorflow Models Using PrometheusMonitoring of GPU Usage with Tensorflow Models Using Prometheus
Monitoring of GPU Usage with Tensorflow Models Using Prometheus
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMC
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 

Viewers also liked

Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
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
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Computer-free Website Development Demo - WordPressDC Jan 2015
 Computer-free Website Development Demo - WordPressDC Jan 2015 Computer-free Website Development Demo - WordPressDC Jan 2015
Computer-free Website Development Demo - WordPressDC Jan 2015Anthony D. Paul
 
Microservices without Servers
Microservices without ServersMicroservices without Servers
Microservices without ServersDev_Events
 
component based softwrae engineering Cbse
component based softwrae engineering Cbsecomponent based softwrae engineering Cbse
component based softwrae engineering CbseSravs Dals
 
Php development with Docker
Php development with DockerPhp development with Docker
Php development with DockerMichael Bui
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting StartedWildan Maulana
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use caserjsmelo
 
Engine lab software hybrid cloud specialists
Engine lab software hybrid cloud specialistsEngine lab software hybrid cloud specialists
Engine lab software hybrid cloud specialistsJohn Rowan
 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopChris Tankersley
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Chris Tankersley
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
2013 Social Admissions Report
 2013 Social Admissions Report   2013 Social Admissions Report
2013 Social Admissions Report Uversity, Inc.
 
NTR Lab - bespoke software development in Russia
NTR Lab - bespoke software development in RussiaNTR Lab - bespoke software development in Russia
NTR Lab - bespoke software development in RussiaOlessya
 
Information Design Web Planning Mockup
Information Design Web Planning MockupInformation Design Web Planning Mockup
Information Design Web Planning MockupANGELA Smithers
 
Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Dev_Events
 

Viewers also liked (20)

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
 
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
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Computer-free Website Development Demo - WordPressDC Jan 2015
 Computer-free Website Development Demo - WordPressDC Jan 2015 Computer-free Website Development Demo - WordPressDC Jan 2015
Computer-free Website Development Demo - WordPressDC Jan 2015
 
Microservices without Servers
Microservices without ServersMicroservices without Servers
Microservices without Servers
 
component based softwrae engineering Cbse
component based softwrae engineering Cbsecomponent based softwrae engineering Cbse
component based softwrae engineering Cbse
 
Php development with Docker
Php development with DockerPhp development with Docker
Php development with Docker
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting Started
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use case
 
Engine lab software hybrid cloud specialists
Engine lab software hybrid cloud specialistsEngine lab software hybrid cloud specialists
Engine lab software hybrid cloud specialists
 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 Workshop
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
2013 Social Admissions Report
 2013 Social Admissions Report   2013 Social Admissions Report
2013 Social Admissions Report
 
NTR Lab - bespoke software development in Russia
NTR Lab - bespoke software development in RussiaNTR Lab - bespoke software development in Russia
NTR Lab - bespoke software development in Russia
 
Spm file33
Spm file33Spm file33
Spm file33
 
Especialidade de inclusão 5
Especialidade de inclusão 5Especialidade de inclusão 5
Especialidade de inclusão 5
 
Information Design Web Planning Mockup
Information Design Web Planning MockupInformation Design Web Planning Mockup
Information Design Web Planning Mockup
 
MockupBuilder
MockupBuilderMockupBuilder
MockupBuilder
 
Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices
 

Similar to Git and Github workshop

Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincitOy
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshellalignan
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with GitRick Umali
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GITGhadiAlGhosh
 
Git tech talk
Git tech talkGit tech talk
Git tech talkrazasayed
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
Git with the flow
Git with the flowGit with the flow
Git with the flowDana White
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfmurad khan
 

Similar to Git and Github workshop (20)

Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git essentials
Git essentialsGit essentials
Git essentials
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
 
Git kelvin
Git   kelvinGit   kelvin
Git kelvin
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git github
Git githubGit github
Git github
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
 
Git training with Devaamo
Git training with DevaamoGit training with Devaamo
Git training with Devaamo
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GIT
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
3 Git
3 Git3 Git
3 Git
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 
Gn unify git
Gn unify gitGn unify git
Gn unify git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 

More from Otto Kekäläinen

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuOtto Kekäläinen
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itOtto Kekäläinen
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuOtto Kekäläinen
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?Otto Kekäläinen
 
Technical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionTechnical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionOtto Kekäläinen
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...Otto Kekäläinen
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...Otto Kekäläinen
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFOtto Kekäläinen
 
The 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themThe 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themOtto Kekäläinen
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesOtto Kekäläinen
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...Otto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsOtto Kekäläinen
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Otto Kekäläinen
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetOtto Kekäläinen
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionOtto Kekäläinen
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingOtto Kekäläinen
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsOtto Kekäläinen
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017Otto Kekäläinen
 

More from Otto Kekäläinen (20)

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and Ubuntu
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
 
Technical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionTechnical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 edition
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoF
 
The 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themThe 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix them
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
Technical SEO for WordPress
Technical SEO for WordPressTechnical SEO for WordPress
Technical SEO for WordPress
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themes
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress plugins
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteet
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 edition
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP Profiling
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environments
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
 

Recently uploaded

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

Git and Github workshop

  • 1. Workshop Git and Github for beginners (and something for advanced too) Otto Kekäläinen Startup.bg 6.11.2015 Sofia,Bulagaria
  • 2. @ottokekalainen ● 15+ years in open source ● technology & business & advocacy ● development with git since 2010
  • 3. The MariaDB Foundation Continuity and open collaboration ● MariaDB.org sponsors include MariaDB.com,Booking.com, Automattic,Odin/Parallels,Visma... ● Employs 6 persons,including ”Monty”Widenius,the creator of MySQL/MariaDB ● Single contact point for collaboration and contributions ● The Foundation makes sure all pull requests and patches are reviewed ● All development work done with git at github.com/mariadb
  • 4. Outline 1.The story of Git 2.Basic commands 3.Doing it with Github 4.Git internals 5.Advanced commands 6.Git everywhere?
  • 6. Git / t/ɡɪ ”A silly,incompetent,stupid, annoying or childish person.” http://en.wiktionary.org/wiki/git
  • 7. "I'm an egotistical bastard,so I name all my projects after myself. First Linux,now Git” Linus Torvalds,PC World.2012-07-14
  • 8. Linus needed a new source code revision manager for Linux,and none of the available options in 2005 where good enough,so he wrote his own in. Kernel 2.6.12 was the first release managed by Git and version 1.0 of Git was released in December 2005.
  • 9. Design goals of Git: ● distributed revision management ● protection against corruption, both accidental and hostile ● speed
  • 10. Git popularity according to OpenHub.net
  • 11. Git popularity according to Google Trends git svn
  • 12. ...but adoption would be faster if it was not so difficult to use. Originally Linus did not intend end users to use Git directly,instead he tried to delegate to somebody else the task of making the actual command line interface. We are still waiting for it... Luckily Git has been simplified and documentation has improved over time,but some Git commands still refer to Git internals that are difficult to grasp. E.g. git-push: Update remote refs along with associated objects.
  • 13. Git might feel difficult at first, but once you learn it, you never want to go back to anything less flexible and powerful.
  • 14. Install on Linux: apt-get install git git-gui Install on Mac/Windows: git-scm.com/downloads
  • 16. First obstacle: same terms with different meanings
  • 17. git config --global user.name "John Doe" git config --global user.email johndoe@example.com Define the author of commits
  • 18. git init git add example.txt git commit -am “First commit” # edit files git commit -am “Second commit” Start a new repository
  • 19. git pull # edit files git commit -am “Implemented X” git push git log git show Typical workflow
  • 20. 3.Doing it with Github
  • 21.
  • 22. Visit http://try.github.com/ After making your first repository,set up SSH key for convenient authentication: https://help.github.com/articles/generating-ssh-keys Note: Github is not the only Git hosting site, Gitlab and Bitbucket are popular too.
  • 23. Exercise: -go to https://github.com/ottok/git-training and fork it -look at the fork under your own Github account and clone it to your laptop -edit names.txt and add yours -push changes back to Github -in Github,do a merge request back to me
  • 24. git clone git://github.com/<yourname>/git-training.git # edit names.txt git commit -am “Added my name” git push # Open pull request on Github
  • 25. The best part of Github is pull requests,and how they enable frictionless collaboration among millions of developers
  • 27. Folder /.git contains everything, your / is just the working copy.
  • 28. Folder /.git contains everything, your / is just the working copy. When you commit a 2 MB file /example.png, your / will grow to 4 MB...
  • 29. When you add a file, it goes to the staging area. The file does not go into the actual history tree until the stage is committed.
  • 30. Commands push and pull and many other commands are shortcuts that act with both your local repository and the remote repositories.
  • 31. Image credits Steve Bennet (http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/)
  • 32.
  • 33. Git tracks content,not files! Git history is immutable as each commit ID is the SHA-1 of the commit data and metadata (including the commit ID of parents).Changing any commit in the history will change the SHA-1 commit IDs of every following commit in the chain. If you need to change something in the history,you have to rebase and make a new history.
  • 34. Git commit IDs and rebase Original 'git log --oneline': 1bf7024 MDEV-8991: bind-address appears twice in default my.cnf b2205c5 MDEV-9011: Redo log encryption does not work cf9e6b2 Fix test failures seen on buildbot. 923827e MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO 239e0c5 MDEV-8551 compilation fails with 10.1.6 After 'git rebase -i HEAD^^^': 34350b9 MDEV-8991: bind-address appears twice in default my.cnf f5f2dd9 MDEV-9011: Redo log encryption does not work 531e1ac Fixed all bugs 923827e MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO 239e0c5 MDEV-8551 compilation fails with 10.1.6
  • 35. Branches and tags Basically just labels that point to certain commit IDs. Each commit ID point to its parent,thus forms a chain.
  • 36. How to write a good commit message ● Your attitude towards commit messages should be the same as for code: it is written once,but read thousands of times. ● Don't explain how was done,that is visible in the diff anyway.Explain what the intention was and why it was made. ● Use imperative form “Fix typo”(instead of “Fixed typo”) ● Keep subject line short and sweet,under 72 chars.Body can be verbose. ● Use proper English.Capital letters.Reference issue identifiers is possible. ● Looking for a good example? How about one by Linus himself? https://github.com/torvalds/linux/commit/fc90888
  • 38. Sorry,but default commands not very friendly,so get yourself good cheat cheets and write up your common commands once you've figured them out.. Image credits Steve Bennet (http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/)
  • 39.
  • 40. Example of how fast-forward works 1/2 ● Branch“feature-branch-example”forked from master branch “10.1”and has 3 commits
  • 41. Example of how fast-forward works 2/2 ● Normal merge defaults to fast-forward in this case ● ● ● Result of no fast-forward (git merge --no-ff)
  • 42. Want to avoid “ugly”merge commits? ● git config pull.ff=only ● git config alias.ff=merge --ff-only ● Run 'git rebase master'to rebase you work on the master branch before pushing or making pull request ● Run 'git merge'on when importing changes from remote head only if you really want to merge
  • 43. Want to put a simple shared repository on any SSH capable server? Create a bare .git with no working files: git init --bare Want to have notifications when somebody commits? Put a shell script at .git/hooks/post-receive
  • 45. Would you like to store all your files in Git? Git-annex Diff of binary files? Add in .git/config [diff"odf"] textconv=odt2txt See also: http://www-verimag.imag.fr/~moy/opendocument/
  • 46. Bug tracker as part of project? http://bugseverywhere.org/ Bug tracker and wiki contents in Git? trac+git Clone wiki from Github with git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.wiki.git
  • 47. Publish to the web with one commit? self-hosted Jekyll or on Github https://pages.github.com/ Open source alternative to Dropbox based on Git? http://sparkleshare.org/
  • 48. Would you like others to contribute to your software? Provide easy forking (git clone), easy way to develop new feature (git branch), and an easy way to send them back (merge request).
  • 49. Will Git credits replace developers CV's?
  • 50. Is there anything we can't store and track in Git?
  • 51. © 2015 MariaDB Foundation51 Thanks! mariadb.org @ottokekalainen otto@mariadb.org