SlideShare a Scribd company logo
Git with the Flow
By Dana White
Who is Dana White?
● This guy
Who is Dana?
● Coder
● Horse enthusiast
● Avid napper
● Contractor at
What is Git?
● Git is a version control system
What is a version control system?
● “Version control is a system that records changes to a file
or set of files over time so that you can recall specific
versions later.” - git-scm
● VCSs allow you to collaborate easily with other
developers, designers, etc
● VCSs allow you to blame others for issues in the code and
mock them
Why is Git different?
● Git is a Distributed Version Control System
● Git is not a Centralized Version Control System
Centralized Version Control System
● A single server has the full repository
● Clients check out latest snapshot
● Must be connected to server checkout and commit code
● SINGLE POINT OF FAILURE
● Popular (?) CVCSs: CVS, SVN
CVCS Diagram
Distributed Version Control System
● Each computer that connects has a full repository
● Commits can occur offline
● NO SINGLE POINT OF FAILURE...YAY!!!
● Popular DVCSs: Mercurial, GIT (the best)
DVCS Diagram
Gitting Started (with someone else’s repo)
● Clone an existing repo
● git clone https://github.com/d-co/wwc.git
How to git
● Write code
● Stage code
● Commit code
● Push Code
Gitting your code in there...
First... Then…
● git add <filename>
● git commit -m
● git push
Code
A quick word about “git add”
● The git add command stages a file for commit
● Adds and stages a previously un-revisioned file
● Stages a modified file for commit
● You could use git commit -a
○ but you’d be wrong
Back up! Know the changes BEFORE commit
git status
Your branch is up-to-date with 'origin/master'.
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: README.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
atextfile.txt
no changes added to commit (use "git add" and/or "git commit -a")
git status - new file
Untracked files:
(use "git add <file>..." to include in what
will be committed)
atextfile.txt
no changes added to commit (use "git add"
and/or "git commit -a")
git status - modified file
Your branch is up-to-date with 'origin/master'.
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: README.md
What changed in that file? - git diff
diff --git a/README.md b/README.md
index bdfac6c..ddf9f4d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
# wwc
This is a basic git repo!!
+Hello
git status - staged for commit
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: README.md
new file: atextfile.txt
Now let’s commit and push
● git commit -m “Added atextfile and said
hello!”
● git push
● NAP TIME!!!
Gitting changes from others
git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0),
pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/d-co/wwc
f4b4f69..b179149 master -> origin/master
Updating f4b4f69..b179149
Fast-forward
README.md | 3 +++
1 file changed, 3 insertions(+)
Wait a minute? What just happened?
git log
commit b17914988de7bc892faea78aea86e2889c53b419
Author: Dana <email@address.com>
Date: Sun Mar 19 23:22:55 2017 -0600
Update README.md
commit f4b4f69c4045438e0dc8ca5e1610d1fe4cd758f9
Author: Dana White <email@address.com>
Date: Sun Mar 19 23:21:17 2017 -0600
This is a commit and hello
Gitting started with your own repo
● git init
● git add README.md
● git commit -m “Your first commit”
● git remote add origin <your url>
● git push -u origin master
Add your git platform origin to git repo
● git init
● git add README.md
● git commit -m “Your first commit”
● git remote add origin <your url>
● git push -u origin master
Set the upstream for pushes
● git init
● git add README.md
● git commit -m “Your first commit”
● git remote add origin <your url>
● git push -u origin master
Branches
● Independent line of development
● Represents brand new dev, staging environment and
project history
● I stole this from
https://www.atlassian.com/git/tutorials/using-branches
Working on branches
● git checkout -b “branch-name”
● Do your work
● git checkout master
● git merge “branch-name”
And that’s all you need to know about git!!!
Provided nothing goes wrong….
Or you need to collaborate
Or maintain releases
Or just follow some best
practices so you’re not
constantly overwriting
what’s in production with no
way of easily going back
Git into trouble?
Something comes up
● Doing work
● Oh no, quick pivot!!
● Follow these steps
Pause work
● Doing work
● Oh no, quick pivot!!
● Follow these steps
● git stash
● git stash pop
Resume Work
● Doing work
● Oh no, quick pivot!!
● Follow these steps
● git stash
● git stash pop
Conflict
● Do some work
● Commit some work
● Git pull…..
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the
result.
Find that conflict
<<<<<<< HEAD
This IS a basic git repo!!
=======
This IS NOT a basic git repo!!
>>>>>>> 89892ec2b035f113fed2be257526dcf6a3603dbe
Fix that conflict
This IS a basic git repo!!
Mark as resolved and continue on
● git add <conflicted file>
● git commit
● git push
OH NO, Everything I did in this file is wrong
● git checkout <filename>
● Reverts all your changes in a given file
OH NO, Everything I did in this whole repo is wrong
● git reset --hard
● Reverts all your changes back to HEAD
OH NO, I forgot <insert thing> with that commit
● git commit --amend
● Allows you to add a file
● Change a commit message
● All around just fix what you forgot in the last commit
OH NO, Revert that commit
● git revert <commit>
● Creates a new commit
● Doesn’t overwrite history
● SAFE
OH NO, I need to kill everything about that
● git rebase/git rebase -i
● Re-writes history
● Use with CAUTION
● UNSAFE
Cases for Rebase
● Joe merged into master (again)
● Eliminate merge commits
● Squash unnecessary commits
Case Joe
● Joe pushed to default
● It is NOT production ready
● If we revert the commit, when we
go to merge it in, pain will ensue
● git rebase -i
● d <commit> “<message>”
● git push
--force-with-lease
Case Eliminate Merge Commits
A---B---C topic
/
D---E---F---G master
● Long running branch
that will need lots of
merges
● git rebase master
topic
A'--B'--C' topic
/
D---E---F---G master
Case Squash
● Do work
● A commit message like “Fixed
this problem”
● Another commit message like
“That didn’t work trying it again”
● “Shoot, another try”
● “Finally got it”
● git rebase -i
● s <commit> “<message>”
● git push
--force-with-lease
The Flow
What is Git Flow?
● A strategy for branching
● Creates an environment for independent, concurrent
development
● Maintains release branches and versions
The diagram
The branches
● master
● develop
● feature branches
● hotfix branches
● release branches
Master Branch
● Should mirror production
● Or be just about to be pushed to production
● Tagged with release numbers
Develop Branch
● Represents what’s currently be developed
● Branched from master
Feature Branches
● Represents a new feature
● Corresponds to one ticket in bug tracking (that’s just me)
● Typically worked on individually or by small team
● Branched off of develop
● Merged into develop
● Naming convention feature/<what’s-my-feature>
Hotfix branches
● Production emergency releases
● Outside of “normal” release
● Branched directly from master
● Merged back into master
● Naming convention: hotfix/<summary-of-hotfix>
Release branches
● The next batch of features to go into production
● Represents a sprint/cycle, whatever flow you’re using
● Branched off of develop
● Merges back into develop and master
● Naming convention: release/<version>
Why flow?
● Features are independent
● Master is always ready for a hotfix
● Allows for lots of different things with minimal toe-stepping
● Great for development with release cycles
Some Advanced Git
Git bisect -- Finding a broken commit
1. Find a commit where things are working
2. Find a commit where things aren’t working
3. Start git bisect
4. Git keeps finding middle point of a bisect and you tell it
what’s good and bad until you’ve traced it down
Git bisect - cont’d
● git bisect start
● git bisect good <commit>
● git bisect bad <commit>
● Mark each commit as good or bad until you find the first
bad commit
Git cherry-pick -- I just need that one thing
● There’s only one commit you need from a branch
● git cherry-pick <commit>
● Merge that one in
Gitignore
● Add a .gitignore file to your repo
● It tells git what to ignore when checking in
● Removes noise about un-revisioned IDE files
Git blame -- who screwed this up
● Traces file changes by username
● One of the few times I prefer a visual client
● git blame <filename>
Resources
Online repos
● BitBucket https://bitbucket.org/product
● GitHub https://github.com/
● Gitlab https://about.gitlab.com/
Git clients...why don’t you like command line???
● SourceTree https://www.sourcetreeapp.com/
● Tortoise (Windows) https://tortoisegit.org/
● Magit https://magit.vc/ -- I don’t know why you need a
client for Emacs, you should just suck it up and do
command line already
● Your IDE - probably
Git HELP!!!
● Git page https://git-scm.com/docs
● StackOverflow https://stackoverflow.com/
● The google (which will probably take you to one of the two
above)
Git with the flow
Ad

More Related Content

What's hot (20)

DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily Use
Mediacurrent
 
Git
GitGit
Git
Shinu Suresh
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Git Flow - An Introduction
Git Flow - An IntroductionGit Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
Git & gitflow
Git & gitflowGit & gitflow
Git & gitflow
Nolifelover Earn
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
Mark Everard
 
The gitflow way
The gitflow wayThe gitflow way
The gitflow way
Ruijun Li
 
Git flow
Git flowGit flow
Git flow
Suraj Aair
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
GIT - GOOD PRACTICES
GIT - GOOD PRACTICESGIT - GOOD PRACTICES
GIT - GOOD PRACTICES
Rodolfo Spalenza
 
Git Tricks
Git TricksGit Tricks
Git Tricks
Ivelina Dimova
 
Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and Tags
Mikhail Melnik
 
Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?
John Congdon
 
Git presentation
Git presentationGit presentation
Git presentation
Sai Kumar Satapathy
 
Git flow
Git flowGit flow
Git flow
Valerio Como
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
Sergiu-Ioan Ungur
 
Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Git
gittower
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
Denis Ristic
 
Pubmi gitflow
Pubmi gitflowPubmi gitflow
Pubmi gitflow
Simone Gentili
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily Use
Mediacurrent
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Git Flow - An Introduction
Git Flow - An IntroductionGit Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
Mark Everard
 
The gitflow way
The gitflow wayThe gitflow way
The gitflow way
Ruijun Li
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and Tags
Mikhail Melnik
 
Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?
John Congdon
 
Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Git
gittower
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
Denis Ristic
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 

Similar to Git with the flow (20)

Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
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
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
Pablo Quiroga
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
Pablo Quiroga
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
Daniel Tai
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
Ashok Kumar
 
3 Git
3 Git3 Git
3 Git
Fabio Fumarola
 
Gn unify git
Gn unify gitGn unify git
Gn unify git
Priyanka Nag
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
聖文 鄭
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
Daniel Tai
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
Ashok Kumar
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
聖文 鄭
 
Ad

Recently uploaded (20)

What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Ad

Git with the flow

  • 1. Git with the Flow By Dana White
  • 2. Who is Dana White? ● This guy
  • 3. Who is Dana? ● Coder ● Horse enthusiast ● Avid napper ● Contractor at
  • 4. What is Git? ● Git is a version control system
  • 5. What is a version control system? ● “Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.” - git-scm ● VCSs allow you to collaborate easily with other developers, designers, etc ● VCSs allow you to blame others for issues in the code and mock them
  • 6. Why is Git different? ● Git is a Distributed Version Control System ● Git is not a Centralized Version Control System
  • 7. Centralized Version Control System ● A single server has the full repository ● Clients check out latest snapshot ● Must be connected to server checkout and commit code ● SINGLE POINT OF FAILURE ● Popular (?) CVCSs: CVS, SVN
  • 9. Distributed Version Control System ● Each computer that connects has a full repository ● Commits can occur offline ● NO SINGLE POINT OF FAILURE...YAY!!! ● Popular DVCSs: Mercurial, GIT (the best)
  • 11. Gitting Started (with someone else’s repo) ● Clone an existing repo ● git clone https://github.com/d-co/wwc.git
  • 12. How to git ● Write code ● Stage code ● Commit code ● Push Code
  • 13. Gitting your code in there... First... Then… ● git add <filename> ● git commit -m ● git push Code
  • 14. A quick word about “git add” ● The git add command stages a file for commit ● Adds and stages a previously un-revisioned file ● Stages a modified file for commit ● You could use git commit -a ○ but you’d be wrong
  • 15. Back up! Know the changes BEFORE commit git status Your branch is up-to-date with 'origin/master'. 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: README.md Untracked files: (use "git add <file>..." to include in what will be committed) atextfile.txt no changes added to commit (use "git add" and/or "git commit -a")
  • 16. git status - new file Untracked files: (use "git add <file>..." to include in what will be committed) atextfile.txt no changes added to commit (use "git add" and/or "git commit -a")
  • 17. git status - modified file Your branch is up-to-date with 'origin/master'. 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: README.md
  • 18. What changed in that file? - git diff diff --git a/README.md b/README.md index bdfac6c..ddf9f4d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # wwc This is a basic git repo!! +Hello
  • 19. git status - staged for commit On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: README.md new file: atextfile.txt
  • 20. Now let’s commit and push ● git commit -m “Added atextfile and said hello!” ● git push ● NAP TIME!!!
  • 21. Gitting changes from others git pull remote: Counting objects: 3, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From https://github.com/d-co/wwc f4b4f69..b179149 master -> origin/master Updating f4b4f69..b179149 Fast-forward README.md | 3 +++ 1 file changed, 3 insertions(+)
  • 22. Wait a minute? What just happened? git log commit b17914988de7bc892faea78aea86e2889c53b419 Author: Dana <[email protected]> Date: Sun Mar 19 23:22:55 2017 -0600 Update README.md commit f4b4f69c4045438e0dc8ca5e1610d1fe4cd758f9 Author: Dana White <[email protected]> Date: Sun Mar 19 23:21:17 2017 -0600 This is a commit and hello
  • 23. Gitting started with your own repo ● git init ● git add README.md ● git commit -m “Your first commit” ● git remote add origin <your url> ● git push -u origin master
  • 24. Add your git platform origin to git repo ● git init ● git add README.md ● git commit -m “Your first commit” ● git remote add origin <your url> ● git push -u origin master
  • 25. Set the upstream for pushes ● git init ● git add README.md ● git commit -m “Your first commit” ● git remote add origin <your url> ● git push -u origin master
  • 26. Branches ● Independent line of development ● Represents brand new dev, staging environment and project history ● I stole this from https://www.atlassian.com/git/tutorials/using-branches
  • 27. Working on branches ● git checkout -b “branch-name” ● Do your work ● git checkout master ● git merge “branch-name”
  • 28. And that’s all you need to know about git!!!
  • 29. Provided nothing goes wrong…. Or you need to collaborate Or maintain releases Or just follow some best practices so you’re not constantly overwriting what’s in production with no way of easily going back
  • 31. Something comes up ● Doing work ● Oh no, quick pivot!! ● Follow these steps
  • 32. Pause work ● Doing work ● Oh no, quick pivot!! ● Follow these steps ● git stash ● git stash pop
  • 33. Resume Work ● Doing work ● Oh no, quick pivot!! ● Follow these steps ● git stash ● git stash pop
  • 34. Conflict ● Do some work ● Commit some work ● Git pull….. CONFLICT (content): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result.
  • 35. Find that conflict <<<<<<< HEAD This IS a basic git repo!! ======= This IS NOT a basic git repo!! >>>>>>> 89892ec2b035f113fed2be257526dcf6a3603dbe
  • 36. Fix that conflict This IS a basic git repo!!
  • 37. Mark as resolved and continue on ● git add <conflicted file> ● git commit ● git push
  • 38. OH NO, Everything I did in this file is wrong ● git checkout <filename> ● Reverts all your changes in a given file
  • 39. OH NO, Everything I did in this whole repo is wrong ● git reset --hard ● Reverts all your changes back to HEAD
  • 40. OH NO, I forgot <insert thing> with that commit ● git commit --amend ● Allows you to add a file ● Change a commit message ● All around just fix what you forgot in the last commit
  • 41. OH NO, Revert that commit ● git revert <commit> ● Creates a new commit ● Doesn’t overwrite history ● SAFE
  • 42. OH NO, I need to kill everything about that ● git rebase/git rebase -i ● Re-writes history ● Use with CAUTION ● UNSAFE
  • 43. Cases for Rebase ● Joe merged into master (again) ● Eliminate merge commits ● Squash unnecessary commits
  • 44. Case Joe ● Joe pushed to default ● It is NOT production ready ● If we revert the commit, when we go to merge it in, pain will ensue ● git rebase -i ● d <commit> “<message>” ● git push --force-with-lease
  • 45. Case Eliminate Merge Commits A---B---C topic / D---E---F---G master ● Long running branch that will need lots of merges ● git rebase master topic A'--B'--C' topic / D---E---F---G master
  • 46. Case Squash ● Do work ● A commit message like “Fixed this problem” ● Another commit message like “That didn’t work trying it again” ● “Shoot, another try” ● “Finally got it” ● git rebase -i ● s <commit> “<message>” ● git push --force-with-lease
  • 48. What is Git Flow? ● A strategy for branching ● Creates an environment for independent, concurrent development ● Maintains release branches and versions
  • 50. The branches ● master ● develop ● feature branches ● hotfix branches ● release branches
  • 51. Master Branch ● Should mirror production ● Or be just about to be pushed to production ● Tagged with release numbers
  • 52. Develop Branch ● Represents what’s currently be developed ● Branched from master
  • 53. Feature Branches ● Represents a new feature ● Corresponds to one ticket in bug tracking (that’s just me) ● Typically worked on individually or by small team ● Branched off of develop ● Merged into develop ● Naming convention feature/<what’s-my-feature>
  • 54. Hotfix branches ● Production emergency releases ● Outside of “normal” release ● Branched directly from master ● Merged back into master ● Naming convention: hotfix/<summary-of-hotfix>
  • 55. Release branches ● The next batch of features to go into production ● Represents a sprint/cycle, whatever flow you’re using ● Branched off of develop ● Merges back into develop and master ● Naming convention: release/<version>
  • 56. Why flow? ● Features are independent ● Master is always ready for a hotfix ● Allows for lots of different things with minimal toe-stepping ● Great for development with release cycles
  • 58. Git bisect -- Finding a broken commit 1. Find a commit where things are working 2. Find a commit where things aren’t working 3. Start git bisect 4. Git keeps finding middle point of a bisect and you tell it what’s good and bad until you’ve traced it down
  • 59. Git bisect - cont’d ● git bisect start ● git bisect good <commit> ● git bisect bad <commit> ● Mark each commit as good or bad until you find the first bad commit
  • 60. Git cherry-pick -- I just need that one thing ● There’s only one commit you need from a branch ● git cherry-pick <commit> ● Merge that one in
  • 61. Gitignore ● Add a .gitignore file to your repo ● It tells git what to ignore when checking in ● Removes noise about un-revisioned IDE files
  • 62. Git blame -- who screwed this up ● Traces file changes by username ● One of the few times I prefer a visual client ● git blame <filename>
  • 64. Online repos ● BitBucket https://bitbucket.org/product ● GitHub https://github.com/ ● Gitlab https://about.gitlab.com/
  • 65. Git clients...why don’t you like command line??? ● SourceTree https://www.sourcetreeapp.com/ ● Tortoise (Windows) https://tortoisegit.org/ ● Magit https://magit.vc/ -- I don’t know why you need a client for Emacs, you should just suck it up and do command line already ● Your IDE - probably
  • 66. Git HELP!!! ● Git page https://git-scm.com/docs ● StackOverflow https://stackoverflow.com/ ● The google (which will probably take you to one of the two above)