ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Improving your
work?ow with GIT
GIT basics
What it is GIT?
Open Source
Distributed
Version Control System
What it is GIT?
Open Source Distributed Version Control System
What it is GIT?
Open Source Distributed Version Control System
What it is GIT?
Open Source Distributed Version Control System
Understanding GIT
Internet
Your local machinegit push
git pull /
git clone /
git fetch
git add
git commit
Don¡¯t be afraid of the GIT
command line
GIT commands
Know what you are doing
git init
git clone /path/to/repository.git
Get and exact copy of the given remote repository into your local machine
Create a new repository
Know what you are doing
git status
Display current status of the working directory
View current branch name
Check for pending changes
Show staged, unstaged and untracked ?les
Know what you are doing
git add Add ?les to the index
git add . # Add all the modified fields to the index
git add filename # Add specific file to the index
git commit Con?rm & save added ?les to your local repository
git commit -m ¡°message description¡± # Write a message in the history and
# save previously added files
Understanding GIT
Internet
Your local machinegit push
git pull /
git clone /
git fetch
git add
git commit
Know what you are doing
git branch List, create or delete branches
git branch # List local branches
git branch -l # List local branches
git branch -r # List remote branches
git branch branchname # Create a branch with branchname
git branch -d branchname # Delete branchname
Know what you are doing
git merge
Join changes from speci?c branch to the
current branch
git merge branch-name
git merge --no-ff branch-name
Using No Fast Forward option helps to have a tidy
git history
Know what you are doing
git checkout Switch branches or restore working tree
git checkout branch-name # Switch to the given branch name (if exist)
git checkout -b branch-name # Create a branch-name and switch to it
git checkout . # Replace all local changes
git checkout filename # Replace filename changes
Know what you are doing
git push Update remote references with your local
git push origin branch-name
git pull Fetch changes from another branch and merge
into the current branch
git pull origin branch-name
git fetch
Know what you are doing
git log
View repository history
git log --oneline
git log -all --decorate --oneline --graph
Know what you are doing
git stash
git stash pop
git stash drop
git stash list
git stash apply stash@{N}
Quick save of current changes
Restore recent saved changes
List all staged work
Remove staged work
Restore specific staged work
Git GUIs
Your IDE
Tortoise GIT
Only Windows
Easy to install and use
Log and Search history
Windows integration
Sourcetree
Windows and Mac
Easy to install and use
Built-in code editor
Bitbucket & Jira integration
Git Kraken
Windows, Mac, Linux
Visual history
Merge con?icts
Built-in code editor
Growing community
Integrations with GitLab, GitHub, Bitbucket
Others
GIT
work?ows
Feature
branches
Solo
work?ow
Git?ow Forking
work?ow
Solo work?ow
¡ñ Single branch
¡ñ Simplicity
¡ñ Small teams *
¡ñ Entry stage for developers
¡ñ Zero e?ort
Feature branches
¡ñ Work on separate functionalities
¡ñ Pull/merge requests (code review)
¡ñ Multiple developers
Git?ow
Git work?ow and extension proposed by
Vincent Driessen
¡ñ Development branch
¡ñ Feature branches
¡ñ Hot?x branches
¡ñ Release branches
¡ñ Custom commands
Git?ow
O?li, C., & O?li, C. (2018, April 09). Git?ow Work?ow, Automated Builds, Integration & Deployment. Retrieved April 20, 2019, from
https://medium.com/devsondevs/git?ow-work?ow-continuous-integration-continuous-delivery-7f4643abb64f
or Metro map?
Git?ow
Git ?ow commands to deal with it
Git?ow vs GIT raw commands
Create a new feature branch
git flow init BRANCHNAME git checkout -b feature/BRANCHNAME
Publish feature branch
git flow feature publish BRANCHNAME git checkout feature/BRANCHNAME
git push origin feature/BRANCHNAME
Finish feature
git flow feature finish MYFEATURE git checkout develop
git merge --no-ff feature/BRANCHNAME
git branch -d feature/BRANCHNAME
Git?ow vs GIT raw commands
New release
git flow release start 1.0 git checkout -b release/1.0 develop
Finish release
git flow release finish 1.0 git checkout master
git merge --no-ff release/1.0
git tag -a 1.0
git checkout develop
git merge --no-ff release/1.0
git branch -d release/1.0
Forking work?ow
¡ñ Server side repository for each developer
¡ñ Public repositories
¡ñ Only maintainer can accept changes
¡ñ Pull/merge requests (code review)
YOUR GIT
WORKFLOW
create & adapt
to your needs
Improving your workflow with git
GitLab. (2018). Retrieved from https://about.gitlab.com/images/press/git-cheat-sheet.pdf
Git. (n.d.). Git. Retrieved from https://git-scm.com/
References & Takeaways
Dudler, R. (2012, January 11). Git cheat sheet. Retrieved from https://rogerdudler.github.io/git-guide/?les/git_cheat_sheet.pdf
Marklodato.github.io. (2019). A Visual Git Reference. [online] Available at: https://marklodato.github.io/visual-git-guide/index-en.html
[Accessed 10 Mar. 2019].
Cottle, P. (2019). Learn Git Branching. [online] Learngitbranching.js.org. Available at: https://learngitbranching.js.org/ [Accessed 09 Mar.
2019].
Roa, H. (2017, August 23). hendrixroa/in-case-of-?re. Retrieved from https://github.com/hendrixroa/in-case-of-?re
Wehner, J. (2019). How to undo (almost) anything with Git - The GitHub Blog. [online] The GitHub Blog. Available at:
https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/ [Accessed 15 Mar. 2019].
Driessen, V. (2010, January 05). A successful Git branching model. Retrieved March 20, 2019, from
https://nvie.com/posts/a-successful-git-branching-model/

More Related Content

What's hot (20)

Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
Knoldus Inc.
?
Git and git flow
Git and git flowGit and git flow
Git and git flow
Fran Garc¨ªa
?
Git basics
Git basicsGit basics
Git basics
Padmavathi Tiwari
?
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
?
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
?
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Luca Milanesio
?
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
?
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
msohn
?
Git undo
Git undoGit undo
Git undo
Avilay Parekh
?
Git tech talk
Git tech talkGit tech talk
Git tech talk
razasayed
?
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
Rick Umali
?
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
?
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Rick Umali
?
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
Nuno Caneco
?
Git flow cheatsheet
Git flow cheatsheetGit flow cheatsheet
Git flow cheatsheet
Funato Takashi
?
Getting Started on distributed version control with git
Getting Started on distributed version control with gitGetting Started on distributed version control with git
Getting Started on distributed version control with git
Anoop Thomas Mathew
?
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
?
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e Merging
Rodrigo Branas
?
Learn Git Fundamentals
Learn Git FundamentalsLearn Git Fundamentals
Learn Git Fundamentals
Jatin Sharma
?
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
Gaurav Kumar Garg
?
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
Knoldus Inc.
?
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
?
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Luca Milanesio
?
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
msohn
?
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
Rick Umali
?
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
?
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Rick Umali
?
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
Nuno Caneco
?
Getting Started on distributed version control with git
Getting Started on distributed version control with gitGetting Started on distributed version control with git
Getting Started on distributed version control with git
Anoop Thomas Mathew
?
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e Merging
Rodrigo Branas
?
Learn Git Fundamentals
Learn Git FundamentalsLearn Git Fundamentals
Learn Git Fundamentals
Jatin Sharma
?
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
Gaurav Kumar Garg
?

Similar to Improving your workflow with git (20)

Git
GitGit
Git
Mayank Patel
?
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
?
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
?
Git basic introduction & tutorial for begginer
Git basic introduction & tutorial for begginerGit basic introduction & tutorial for begginer
Git basic introduction & tutorial for begginer
AnDiLestiAnto2
?
Git
GitGit
Git
Terry Wang
?
Git ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ùGit ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ù
Terry Wang
?
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
John Stevenson
?
Git ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ùGit ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ù
Terry Wang
?
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
?
Git github
Git githubGit github
Git github
Anurag Deb
?
Git and Github
Git and GithubGit and Github
Git and Github
Teodora Ahkozidou
?
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
Gourav Varma
?
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
GDSC UofT Mississauga
?
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
?
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
?
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
?
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
?
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
?
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
?
Git
GitGit
Git
IT Booze
?
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
?
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
?
Git basic introduction & tutorial for begginer
Git basic introduction & tutorial for begginerGit basic introduction & tutorial for begginer
Git basic introduction & tutorial for begginer
AnDiLestiAnto2
?
Git ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ùGit ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ù
Terry Wang
?
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
John Stevenson
?
Git ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ùGit ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ù
Terry Wang
?
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
?
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
Gourav Varma
?
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
?
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
?
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
?

Recently uploaded (20)

SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly MeetupBeyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
GDG Kathmandu
?
202408_JAWSPANKRATION_Introduction_of_Minaden.pdf
202408_JAWSPANKRATION_Introduction_of_Minaden.pdf202408_JAWSPANKRATION_Introduction_of_Minaden.pdf
202408_JAWSPANKRATION_Introduction_of_Minaden.pdf
NTTDOCOMO-ServiceInnovation
?
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
?
Getting the Best of TrueDEM ¨C April News & Updates
Getting the Best of TrueDEM ¨C April News & UpdatesGetting the Best of TrueDEM ¨C April News & Updates
Getting the Best of TrueDEM ¨C April News & Updates
panagenda
?
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
?
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsMastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
?
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
?
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
DianaGray10
?
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
?
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz
?
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMARSTRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
?
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD TechnicianRicardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno
?
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
?
Next.js Development: The Ultimate Solution for High-Performance Web Apps
Next.js Development: The Ultimate Solution for High-Performance Web AppsNext.js Development: The Ultimate Solution for High-Performance Web Apps
Next.js Development: The Ultimate Solution for High-Performance Web Apps
rwinfotech31
?
San Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdfSan Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdf
Matt Doar
?
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
?
Transactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptxTransactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptx
Maysam Mousa
?
Columbia Weather Systems - Product Overview
Columbia Weather Systems - Product OverviewColumbia Weather Systems - Product Overview
Columbia Weather Systems - Product Overview
Columbia Weather Systems
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly MeetupBeyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
GDG Kathmandu
?
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
?
Getting the Best of TrueDEM ¨C April News & Updates
Getting the Best of TrueDEM ¨C April News & UpdatesGetting the Best of TrueDEM ¨C April News & Updates
Getting the Best of TrueDEM ¨C April News & Updates
panagenda
?
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
?
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsMastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
?
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
?
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
SAP Automation with UiPath: SAP Test Automation - Part 5 of 8
DianaGray10
?
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
?
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz
?
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMARSTRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
?
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD TechnicianRicardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno
?
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
?
Next.js Development: The Ultimate Solution for High-Performance Web Apps
Next.js Development: The Ultimate Solution for High-Performance Web AppsNext.js Development: The Ultimate Solution for High-Performance Web Apps
Next.js Development: The Ultimate Solution for High-Performance Web Apps
rwinfotech31
?
San Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdfSan Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdf
Matt Doar
?
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
?
Transactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptxTransactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptx
Maysam Mousa
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?

Improving your workflow with git

  • 3. What it is GIT? Open Source Distributed Version Control System
  • 4. What it is GIT? Open Source Distributed Version Control System
  • 5. What it is GIT? Open Source Distributed Version Control System
  • 6. What it is GIT? Open Source Distributed Version Control System
  • 7. Understanding GIT Internet Your local machinegit push git pull / git clone / git fetch git add git commit
  • 8. Don¡¯t be afraid of the GIT command line GIT commands
  • 9. Know what you are doing git init git clone /path/to/repository.git Get and exact copy of the given remote repository into your local machine Create a new repository
  • 10. Know what you are doing git status Display current status of the working directory View current branch name Check for pending changes Show staged, unstaged and untracked ?les
  • 11. Know what you are doing git add Add ?les to the index git add . # Add all the modified fields to the index git add filename # Add specific file to the index git commit Con?rm & save added ?les to your local repository git commit -m ¡°message description¡± # Write a message in the history and # save previously added files
  • 12. Understanding GIT Internet Your local machinegit push git pull / git clone / git fetch git add git commit
  • 13. Know what you are doing git branch List, create or delete branches git branch # List local branches git branch -l # List local branches git branch -r # List remote branches git branch branchname # Create a branch with branchname git branch -d branchname # Delete branchname
  • 14. Know what you are doing git merge Join changes from speci?c branch to the current branch git merge branch-name git merge --no-ff branch-name Using No Fast Forward option helps to have a tidy git history
  • 15. Know what you are doing git checkout Switch branches or restore working tree git checkout branch-name # Switch to the given branch name (if exist) git checkout -b branch-name # Create a branch-name and switch to it git checkout . # Replace all local changes git checkout filename # Replace filename changes
  • 16. Know what you are doing git push Update remote references with your local git push origin branch-name git pull Fetch changes from another branch and merge into the current branch git pull origin branch-name git fetch
  • 17. Know what you are doing git log View repository history git log --oneline git log -all --decorate --oneline --graph
  • 18. Know what you are doing git stash git stash pop git stash drop git stash list git stash apply stash@{N} Quick save of current changes Restore recent saved changes List all staged work Remove staged work Restore specific staged work
  • 21. Tortoise GIT Only Windows Easy to install and use Log and Search history Windows integration
  • 22. Sourcetree Windows and Mac Easy to install and use Built-in code editor Bitbucket & Jira integration
  • 23. Git Kraken Windows, Mac, Linux Visual history Merge con?icts Built-in code editor Growing community Integrations with GitLab, GitHub, Bitbucket
  • 27. Solo work?ow ¡ñ Single branch ¡ñ Simplicity ¡ñ Small teams * ¡ñ Entry stage for developers ¡ñ Zero e?ort
  • 28. Feature branches ¡ñ Work on separate functionalities ¡ñ Pull/merge requests (code review) ¡ñ Multiple developers
  • 29. Git?ow Git work?ow and extension proposed by Vincent Driessen ¡ñ Development branch ¡ñ Feature branches ¡ñ Hot?x branches ¡ñ Release branches ¡ñ Custom commands
  • 30. Git?ow O?li, C., & O?li, C. (2018, April 09). Git?ow Work?ow, Automated Builds, Integration & Deployment. Retrieved April 20, 2019, from https://medium.com/devsondevs/git?ow-work?ow-continuous-integration-continuous-delivery-7f4643abb64f or Metro map?
  • 31. Git?ow Git ?ow commands to deal with it
  • 32. Git?ow vs GIT raw commands Create a new feature branch git flow init BRANCHNAME git checkout -b feature/BRANCHNAME Publish feature branch git flow feature publish BRANCHNAME git checkout feature/BRANCHNAME git push origin feature/BRANCHNAME Finish feature git flow feature finish MYFEATURE git checkout develop git merge --no-ff feature/BRANCHNAME git branch -d feature/BRANCHNAME
  • 33. Git?ow vs GIT raw commands New release git flow release start 1.0 git checkout -b release/1.0 develop Finish release git flow release finish 1.0 git checkout master git merge --no-ff release/1.0 git tag -a 1.0 git checkout develop git merge --no-ff release/1.0 git branch -d release/1.0
  • 34. Forking work?ow ¡ñ Server side repository for each developer ¡ñ Public repositories ¡ñ Only maintainer can accept changes ¡ñ Pull/merge requests (code review)
  • 35. YOUR GIT WORKFLOW create & adapt to your needs
  • 37. GitLab. (2018). Retrieved from https://about.gitlab.com/images/press/git-cheat-sheet.pdf Git. (n.d.). Git. Retrieved from https://git-scm.com/ References & Takeaways Dudler, R. (2012, January 11). Git cheat sheet. Retrieved from https://rogerdudler.github.io/git-guide/?les/git_cheat_sheet.pdf Marklodato.github.io. (2019). A Visual Git Reference. [online] Available at: https://marklodato.github.io/visual-git-guide/index-en.html [Accessed 10 Mar. 2019]. Cottle, P. (2019). Learn Git Branching. [online] Learngitbranching.js.org. Available at: https://learngitbranching.js.org/ [Accessed 09 Mar. 2019]. Roa, H. (2017, August 23). hendrixroa/in-case-of-?re. Retrieved from https://github.com/hendrixroa/in-case-of-?re Wehner, J. (2019). How to undo (almost) anything with Git - The GitHub Blog. [online] The GitHub Blog. Available at: https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/ [Accessed 15 Mar. 2019]. Driessen, V. (2010, January 05). A successful Git branching model. Retrieved March 20, 2019, from https://nvie.com/posts/a-successful-git-branching-model/