SlideShare a Scribd company logo
1 of 17
Download to read offline
WordCamp Norrköping August 28, 2015
Take the next step with git
OriginalAuthor/AwesomeProject MyGithubName/AwesomeProject
push
PathToMyRepo/AwesomeProject
pull
make
pull request
originupstream
the pull-request collaboration model
proposed by Vincent Driessen
 master and develop are long-lived branches
 feature-, release- and hotfix- branches gets
deleted when they are finished
 suitable for projects with traditional release
cycles and semantic versioning
git-flow
github flow
master
small-bugfix
awesome-feature
when deployment happens often
 master branch is always deployable
 all development happens in topic branches
 topic branches are verified before merging
 suitable for more agile environments with
shorter development cycles and regular
deployments
pull request is branch to branch
topic branches gets deleted after they are merged
work in topic branches - use pull requests
develop
initialize pull-request
my-feature →develop
my-feature
git log will show you the history
source: http://xkcd.com/1296/
write helpful commit messages
git commit -m “Fix login bug” Redirect user to the requested page after login
https://trello.com/path/to/relevant/card
Users were being redirected to the home page
after login. It is better to send them back to
the page they had originally requested before
they were redirected to the login form.
* Store requested path in a session variable
* Redirect to the stored location after
successfully logging in the user
vs
all the world is a stage
- first.php
- second.php*
- third.php
- assets
- first.js*
- second.css
- fourth.php
stagework commit
second.php
first.js
59ab5f84 Add awesome feature
add part of a file to the stage
[~/_gitrepos/wcnkpg2015] (develop *) $ git add -p
diff --git a/functions.php b/functions.php
index 3ccacf2..53a67e2 100644
--- a/functions.php
+++ b/functions.php
@@ -10,8 +10,32 @@
[big diff of all changes to the file]
Stage this hunk [y,n,q,a,d,/,s,e,?]? s
use ”git add -p” or ”git add --patch”
options
y - stage this hunk
n - do not stage this hunk
q - quit; do not stage this hunk or any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk or any of the later hunks in the file
/ - search for a hunk matching the given regex
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help
[~/_gitrepos/wcnkpg2015] (develop *+) $ git status
On branch develop
Changes to be committed:
(use “git reset HEAD <file>...” to unstage)
modified: functions.php
Changes not staged for commit:
(use “git add <file>...” to update what will be committed)
(use “git checkout -- <file>...” to discard changes in working directory)
modified: functions.php
[~/_gitrepos/wcnkpg2015] (develop *+) $ git commit
[develop 0337c46] Add theme setup scaffolding
1 file changed, 12 insertions(+)
[~/_gitrepos/wcnkpg2015] (develop *) $
review all changes staged for commit with
git status -v
or
git diff --staged
- first.php
- second.php*
- third.php
- assets
- first.js*
- second.css
- fourth.php
- fifth.php
- first.php
- second.php
- third.php
- assets
- first.js
- second.css
- fourth.php
- fifth.php
second.php
first.js
fifth.php
stage commit --amend
fifth.php
74c35a5f Add awesome feature
- first.php
- second.php*
- third.php
- assets
- first.js*
- second.css
- fourth.php
- fifth.php
stagework commit
second.php
first.js
second.php
first.js
59ab5f84 Add awesome feature
amend previous commit
the history has been changed
59ab5f84 Add awesome feature
74c35a5f Add awesome feature
before
after
rebase
develop
my-feature
master
develop
my-feature
git rebase develop
moves the base of the topic branch to develop
the commits are discarded and the patches
reapplied to the new branch, creating new commits
rebase vs merge
rebase
 use only on a short-lived local
topic branch
 makes the history cleaner
 will update your work to be
based on the latest upstream
development
merge
 when a branch has been shared
with other developers
 is non-destructive
 can make history harder to
follow if there are many merge
commits
summary
 choose and follow a branching strategy
 take advantage of the staging area
 be mindful of the history
 never rewrite history on shared branches
KARIN TALIGA
@_middlesister
�https://github.com/middlesister
invistruct.com
Thank you!

More Related Content

What's hot

Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Gitgittower
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
 
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 GitE Carter
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubRick Umali
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using GithubSujata Regoti
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheetAbdul Basit
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With GitflowJosh Dvir
 
Latex with git
Latex with gitLatex with git
Latex with gitsppmg
 

What's hot (20)

Git
GitGit
Git
 
Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Git
 
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
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
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
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Git flow cheatsheet
Git flow cheatsheetGit flow cheatsheet
Git flow cheatsheet
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
 
Github
GithubGithub
Github
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With Gitflow
 
Latex with git
Latex with gitLatex with git
Latex with git
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 

Viewers also liked

Optimizing WordPress Performance
Optimizing WordPress PerformanceOptimizing WordPress Performance
Optimizing WordPress PerformanceDouglas Yuen
 
BuddyPress Tips: How We Built chekmrk
BuddyPress Tips: How We Built chekmrkBuddyPress Tips: How We Built chekmrk
BuddyPress Tips: How We Built chekmrkWes Chyrchel
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboySteve Mortiboy
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWFTim Plummer
 
The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!Denise (Dee) Teal
 
Getting an eCommerce Site Running in 30 Minutes
Getting an eCommerce Site Running in 30 MinutesGetting an eCommerce Site Running in 30 Minutes
Getting an eCommerce Site Running in 30 MinutesApptivo
 
Website Security - It Begins With Good Posture
Website Security - It Begins With Good PostureWebsite Security - It Begins With Good Posture
Website Security - It Begins With Good PostureTony Perez
 
Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? GGDBologna
 
Understanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsUnderstanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsIan Wilson
 
Working Off Grid & Remote
Working Off Grid & RemoteWorking Off Grid & Remote
Working Off Grid & Remotetravistotz
 
Introduction to WordPress Multisite
Introduction to WordPress MultisiteIntroduction to WordPress Multisite
Introduction to WordPress MultisiteCraig Taylor
 
Future of WordPress in Nashville 2013
Future of WordPress in Nashville 2013Future of WordPress in Nashville 2013
Future of WordPress in Nashville 2013John Housholder
 
Truly Dynamic Sidebars for WordPress
Truly Dynamic Sidebars for WordPressTruly Dynamic Sidebars for WordPress
Truly Dynamic Sidebars for WordPressednailor
 
Cómo crear plugins para Wordpress
Cómo crear plugins para WordpressCómo crear plugins para Wordpress
Cómo crear plugins para Wordpressralcocer
 
A house with no walls: Creating a site structure for the future
A house with no walls: Creating a site structure for the futureA house with no walls: Creating a site structure for the future
A house with no walls: Creating a site structure for the futureGizmo Creative Factory, Inc.
 
Design and Development Techniques for Accessibility: WordCamp Tampa 2015
Design and Development Techniques for Accessibility: WordCamp Tampa 2015Design and Development Techniques for Accessibility: WordCamp Tampa 2015
Design and Development Techniques for Accessibility: WordCamp Tampa 2015Robert Jolly
 
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiWordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiShanta Nathwani
 

Viewers also liked (20)

WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Optimizing WordPress Performance
Optimizing WordPress PerformanceOptimizing WordPress Performance
Optimizing WordPress Performance
 
BuddyPress Tips: How We Built chekmrk
BuddyPress Tips: How We Built chekmrkBuddyPress Tips: How We Built chekmrk
BuddyPress Tips: How We Built chekmrk
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve Mortiboy
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWF
 
The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!
 
Getting an eCommerce Site Running in 30 Minutes
Getting an eCommerce Site Running in 30 MinutesGetting an eCommerce Site Running in 30 Minutes
Getting an eCommerce Site Running in 30 Minutes
 
WordCamp 2015
WordCamp 2015WordCamp 2015
WordCamp 2015
 
Website Security - It Begins With Good Posture
Website Security - It Begins With Good PostureWebsite Security - It Begins With Good Posture
Website Security - It Begins With Good Posture
 
Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress?
 
Understanding WordPress Filters and Actions
Understanding WordPress Filters and ActionsUnderstanding WordPress Filters and Actions
Understanding WordPress Filters and Actions
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
 
Working Off Grid & Remote
Working Off Grid & RemoteWorking Off Grid & Remote
Working Off Grid & Remote
 
Introduction to WordPress Multisite
Introduction to WordPress MultisiteIntroduction to WordPress Multisite
Introduction to WordPress Multisite
 
Future of WordPress in Nashville 2013
Future of WordPress in Nashville 2013Future of WordPress in Nashville 2013
Future of WordPress in Nashville 2013
 
Truly Dynamic Sidebars for WordPress
Truly Dynamic Sidebars for WordPressTruly Dynamic Sidebars for WordPress
Truly Dynamic Sidebars for WordPress
 
Cómo crear plugins para Wordpress
Cómo crear plugins para WordpressCómo crear plugins para Wordpress
Cómo crear plugins para Wordpress
 
A house with no walls: Creating a site structure for the future
A house with no walls: Creating a site structure for the futureA house with no walls: Creating a site structure for the future
A house with no walls: Creating a site structure for the future
 
Design and Development Techniques for Accessibility: WordCamp Tampa 2015
Design and Development Techniques for Accessibility: WordCamp Tampa 2015Design and Development Techniques for Accessibility: WordCamp Tampa 2015
Design and Development Techniques for Accessibility: WordCamp Tampa 2015
 
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChiWordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
WordPress 101 - Foundation Friday at WordCamp Chicago 2014 #WCChi
 

Similar to Take the next step with git

Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Contributing to Open Source with GitHub GDSC
Contributing to Open Source with GitHub GDSCContributing to Open Source with GitHub GDSC
Contributing to Open Source with GitHub GDSCAyanMasood1
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - WorkflowTahsin Abrar
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__greyKing Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__whiteKing Hom
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_darkKing Hom
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-itAutomat-IT
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAtlassian
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOpsNicola Baldi
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践Terry Wang
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Codemotion
 

Similar to Take the next step with git (20)

Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Contributing to Open Source with GitHub GDSC
Contributing to Open Source with GitHub GDSCContributing to Open Source with GitHub GDSC
Contributing to Open Source with GitHub GDSC
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git and github
Git and githubGit and github
Git and github
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
 
Git github
Git githubGit github
Git github
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
Git 101
Git 101Git 101
Git 101
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Take the next step with git

  • 1. WordCamp Norrköping August 28, 2015 Take the next step with git
  • 3. proposed by Vincent Driessen  master and develop are long-lived branches  feature-, release- and hotfix- branches gets deleted when they are finished  suitable for projects with traditional release cycles and semantic versioning git-flow
  • 4. github flow master small-bugfix awesome-feature when deployment happens often  master branch is always deployable  all development happens in topic branches  topic branches are verified before merging  suitable for more agile environments with shorter development cycles and regular deployments
  • 5. pull request is branch to branch topic branches gets deleted after they are merged work in topic branches - use pull requests develop initialize pull-request my-feature →develop my-feature
  • 6. git log will show you the history source: http://xkcd.com/1296/
  • 7. write helpful commit messages git commit -m “Fix login bug” Redirect user to the requested page after login https://trello.com/path/to/relevant/card Users were being redirected to the home page after login. It is better to send them back to the page they had originally requested before they were redirected to the login form. * Store requested path in a session variable * Redirect to the stored location after successfully logging in the user vs
  • 8. all the world is a stage - first.php - second.php* - third.php - assets - first.js* - second.css - fourth.php stagework commit second.php first.js 59ab5f84 Add awesome feature
  • 9. add part of a file to the stage [~/_gitrepos/wcnkpg2015] (develop *) $ git add -p diff --git a/functions.php b/functions.php index 3ccacf2..53a67e2 100644 --- a/functions.php +++ b/functions.php @@ -10,8 +10,32 @@ [big diff of all changes to the file] Stage this hunk [y,n,q,a,d,/,s,e,?]? s use ”git add -p” or ”git add --patch”
  • 10. options y - stage this hunk n - do not stage this hunk q - quit; do not stage this hunk or any of the remaining ones a - stage this hunk and all later hunks in the file d - do not stage this hunk or any of the later hunks in the file / - search for a hunk matching the given regex s - split the current hunk into smaller hunks e - manually edit the current hunk ? - print help
  • 11. [~/_gitrepos/wcnkpg2015] (develop *+) $ git status On branch develop Changes to be committed: (use “git reset HEAD <file>...” to unstage) modified: functions.php Changes not staged for commit: (use “git add <file>...” to update what will be committed) (use “git checkout -- <file>...” to discard changes in working directory) modified: functions.php [~/_gitrepos/wcnkpg2015] (develop *+) $ git commit [develop 0337c46] Add theme setup scaffolding 1 file changed, 12 insertions(+) [~/_gitrepos/wcnkpg2015] (develop *) $ review all changes staged for commit with git status -v or git diff --staged
  • 12. - first.php - second.php* - third.php - assets - first.js* - second.css - fourth.php - fifth.php - first.php - second.php - third.php - assets - first.js - second.css - fourth.php - fifth.php second.php first.js fifth.php stage commit --amend fifth.php 74c35a5f Add awesome feature - first.php - second.php* - third.php - assets - first.js* - second.css - fourth.php - fifth.php stagework commit second.php first.js second.php first.js 59ab5f84 Add awesome feature amend previous commit
  • 13. the history has been changed 59ab5f84 Add awesome feature 74c35a5f Add awesome feature before after
  • 14. rebase develop my-feature master develop my-feature git rebase develop moves the base of the topic branch to develop the commits are discarded and the patches reapplied to the new branch, creating new commits
  • 15. rebase vs merge rebase  use only on a short-lived local topic branch  makes the history cleaner  will update your work to be based on the latest upstream development merge  when a branch has been shared with other developers  is non-destructive  can make history harder to follow if there are many merge commits
  • 16. summary  choose and follow a branching strategy  take advantage of the staging area  be mindful of the history  never rewrite history on shared branches