SlideShare a Scribd company logo
1 of 21
Git Primer
Git is Version Control for code
management. It allows us to
collaborate, track changes or
updates, and facilitates an
efficient and thoroughly
reviewed workflow.
Github Introduction
What is Github?
Github is an online repository for storing collaborative code that is version-controlled
How does Github work?
Version control is achieved using the UNIX program git (more info later)
What should be stored on Github?
All code and documentation required for each project
What SHOULD NOT be stored on Github?
Sensitive information (passwords, client’s data)
Trained models, output files (use S3 if necessary)
Large files - Github has a file-size limit of 100MB
git: Like a Multiplayer Notepad...
1. Keeping up to date (git pull)
2. Leaving breadcrumbs (or checkpoints)
3. Review, Approve, Merge
4. Branches!
5. Getting out of a pickle
git pull a day
keeps the conflicts away…
peak.ai
git pull
Make sure you are using the latest version
`git pull` will get all the branches
Commit early, commit often.
A tip for version controlling.
commit, commit, commit, push!
Think functionality over time. Added a new function? Commit.
Fixed the syntax of that erroneous line? Commit.
You can commit as much as you like before actually pushing.
Be careful not to remove the
branch you're standing on
Be careful not to remove the branch you're standing on
You can create feature branches. These should be
used to work on specific, module chunks of code.
Remember they should all get merged into one
‘master’ file later.
branching
Merge now
or forever hold your peace…
To produce high quality work we should review and
understand each others work.
We should be responsible for our work
To collaborate together we need to be reading from the
same page.
PRs, Reviews,
Merging
git happens!
Going back to square one: Common Issues
Undo local commits
git reset HEAD~2 # undo last two commits, keep changes
git reset --hard HEAD~2 # undo last two commits, discard changes
Remove a file from git, but keep it locally
git reset filename # or git remove --cached filename
echo filename >> .gitignore # add it to .gitignore to avoid re-adding it
Edit the last commit
git commit --amend # start $EDITOR to edit the message
git commit --amend -m "New message" # set the new message directly
git add forgotten_file
git commit --amend
View log of commits (with commit Ids)
git log
Reset to previous commit (Run git log to see Ids!)
git reset --hard <some-commit>
Reset changes to a particular file
git checkout -- ignoreChangesToThisFile.txt
Turn it off and on again!
rm -fr ~/myrepo/ && git clone myrepo
Fin.

More Related Content

What's hot

Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with GitRick Umali
 
Git & version control crash course
Git & version control crash course Git & version control crash course
Git & version control crash course Eslam Saeed
 
Gitt and Git-flow
Gitt and Git-flowGitt and Git-flow
Gitt and Git-flowMd. Masud
 
Git in 10 minutes (WordCamp London 2018)
Git in 10 minutes (WordCamp London 2018)Git in 10 minutes (WordCamp London 2018)
Git in 10 minutes (WordCamp London 2018)Borek Bernard
 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Luca Milanesio
 
Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using GitYan Vugenfirer
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Celestine Omin
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github SahilSonar4
 
Say Hello to awesomeness: Let’s learn the essentials of GitHub
Say Hello to awesomeness: Let’s learn the essentials of GitHubSay Hello to awesomeness: Let’s learn the essentials of GitHub
Say Hello to awesomeness: Let’s learn the essentials of GitHubSmile Gupta
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ GitheyMP
 
Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1ahmadezzeir
 

What's hot (20)

GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
 
Gn unify git
Gn unify gitGn unify git
Gn unify git
 
Git & version control crash course
Git & version control crash course Git & version control crash course
Git & version control crash course
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Gitt and Git-flow
Gitt and Git-flowGitt and Git-flow
Gitt and Git-flow
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git in 10 minutes (WordCamp London 2018)
Git in 10 minutes (WordCamp London 2018)Git in 10 minutes (WordCamp London 2018)
Git in 10 minutes (WordCamp London 2018)
 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using Git
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
 
Say Hello to awesomeness: Let’s learn the essentials of GitHub
Say Hello to awesomeness: Let’s learn the essentials of GitHubSay Hello to awesomeness: Let’s learn the essentials of GitHub
Say Hello to awesomeness: Let’s learn the essentials of GitHub
 
Github
GithubGithub
Github
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1
 
Git basics
Git basicsGit basics
Git basics
 
Git 101
Git 101Git 101
Git 101
 

Similar to Git Primer

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
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshellalignan
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincitOy
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - WorkflowTahsin Abrar
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfmurad khan
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 

Similar to Git Primer (20)

Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Git github
Git githubGit github
Git github
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Git essentials
Git essentialsGit essentials
Git essentials
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
16 Git
16 Git16 Git
16 Git
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
Git introduction
Git introductionGit introduction
Git introduction
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 

More from Michael Pearce

MLOps - Getting Machine Learning Into Production
MLOps - Getting Machine Learning Into ProductionMLOps - Getting Machine Learning Into Production
MLOps - Getting Machine Learning Into ProductionMichael Pearce
 
Look mum, no hands! AWS Systems Manager for server management and automation.
Look mum, no hands! AWS Systems Manager for server management and automation.Look mum, no hands! AWS Systems Manager for server management and automation.
Look mum, no hands! AWS Systems Manager for server management and automation.Michael Pearce
 
IaC: Tools of the trade
IaC: Tools of the tradeIaC: Tools of the trade
IaC: Tools of the tradeMichael Pearce
 
Sage Advice: Getting started with Amazon SageMaker
Sage Advice: Getting started with Amazon SageMakerSage Advice: Getting started with Amazon SageMaker
Sage Advice: Getting started with Amazon SageMakerMichael Pearce
 
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time around
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time aroundLearning, Losing & Lessons Learnt: Cloud Certification the 2nd time around
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time aroundMichael Pearce
 
Building Scalable Data Ingestion
Building Scalable Data Ingestion Building Scalable Data Ingestion
Building Scalable Data Ingestion Michael Pearce
 
Cloud Security and some preferred practices
Cloud Security and some preferred practicesCloud Security and some preferred practices
Cloud Security and some preferred practicesMichael Pearce
 
Building scalable infrastructure for AI & ML
Building scalable infrastructure for AI & MLBuilding scalable infrastructure for AI & ML
Building scalable infrastructure for AI & MLMichael Pearce
 
Infrastructure as Code (IaC): Introduction to scripted infrastructure
Infrastructure as Code (IaC): Introduction to scripted infrastructureInfrastructure as Code (IaC): Introduction to scripted infrastructure
Infrastructure as Code (IaC): Introduction to scripted infrastructureMichael Pearce
 
Cloudphrase: AWS basics
Cloudphrase: AWS basicsCloudphrase: AWS basics
Cloudphrase: AWS basicsMichael Pearce
 
Introduction to AWS VPC & Networking
Introduction to AWS VPC & NetworkingIntroduction to AWS VPC & Networking
Introduction to AWS VPC & NetworkingMichael Pearce
 
Alexa, call SageMaker!
Alexa, call SageMaker!Alexa, call SageMaker!
Alexa, call SageMaker!Michael Pearce
 

More from Michael Pearce (13)

MLOps - Getting Machine Learning Into Production
MLOps - Getting Machine Learning Into ProductionMLOps - Getting Machine Learning Into Production
MLOps - Getting Machine Learning Into Production
 
Linux CLI Primer
Linux CLI PrimerLinux CLI Primer
Linux CLI Primer
 
Look mum, no hands! AWS Systems Manager for server management and automation.
Look mum, no hands! AWS Systems Manager for server management and automation.Look mum, no hands! AWS Systems Manager for server management and automation.
Look mum, no hands! AWS Systems Manager for server management and automation.
 
IaC: Tools of the trade
IaC: Tools of the tradeIaC: Tools of the trade
IaC: Tools of the trade
 
Sage Advice: Getting started with Amazon SageMaker
Sage Advice: Getting started with Amazon SageMakerSage Advice: Getting started with Amazon SageMaker
Sage Advice: Getting started with Amazon SageMaker
 
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time around
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time aroundLearning, Losing & Lessons Learnt: Cloud Certification the 2nd time around
Learning, Losing & Lessons Learnt: Cloud Certification the 2nd time around
 
Building Scalable Data Ingestion
Building Scalable Data Ingestion Building Scalable Data Ingestion
Building Scalable Data Ingestion
 
Cloud Security and some preferred practices
Cloud Security and some preferred practicesCloud Security and some preferred practices
Cloud Security and some preferred practices
 
Building scalable infrastructure for AI & ML
Building scalable infrastructure for AI & MLBuilding scalable infrastructure for AI & ML
Building scalable infrastructure for AI & ML
 
Infrastructure as Code (IaC): Introduction to scripted infrastructure
Infrastructure as Code (IaC): Introduction to scripted infrastructureInfrastructure as Code (IaC): Introduction to scripted infrastructure
Infrastructure as Code (IaC): Introduction to scripted infrastructure
 
Cloudphrase: AWS basics
Cloudphrase: AWS basicsCloudphrase: AWS basics
Cloudphrase: AWS basics
 
Introduction to AWS VPC & Networking
Introduction to AWS VPC & NetworkingIntroduction to AWS VPC & Networking
Introduction to AWS VPC & Networking
 
Alexa, call SageMaker!
Alexa, call SageMaker!Alexa, call SageMaker!
Alexa, call SageMaker!
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Git Primer

  • 2. Git is Version Control for code management. It allows us to collaborate, track changes or updates, and facilitates an efficient and thoroughly reviewed workflow.
  • 3. Github Introduction What is Github? Github is an online repository for storing collaborative code that is version-controlled How does Github work? Version control is achieved using the UNIX program git (more info later) What should be stored on Github? All code and documentation required for each project What SHOULD NOT be stored on Github? Sensitive information (passwords, client’s data) Trained models, output files (use S3 if necessary) Large files - Github has a file-size limit of 100MB
  • 4. git: Like a Multiplayer Notepad... 1. Keeping up to date (git pull) 2. Leaving breadcrumbs (or checkpoints) 3. Review, Approve, Merge 4. Branches! 5. Getting out of a pickle
  • 5. git pull a day keeps the conflicts away…
  • 6. peak.ai git pull Make sure you are using the latest version `git pull` will get all the branches
  • 7. Commit early, commit often. A tip for version controlling.
  • 8. commit, commit, commit, push! Think functionality over time. Added a new function? Commit. Fixed the syntax of that erroneous line? Commit. You can commit as much as you like before actually pushing.
  • 9. Be careful not to remove the branch you're standing on
  • 10. Be careful not to remove the branch you're standing on
  • 11. You can create feature branches. These should be used to work on specific, module chunks of code. Remember they should all get merged into one ‘master’ file later. branching
  • 12. Merge now or forever hold your peace…
  • 13. To produce high quality work we should review and understand each others work. We should be responsible for our work To collaborate together we need to be reading from the same page. PRs, Reviews, Merging
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 20. Going back to square one: Common Issues Undo local commits git reset HEAD~2 # undo last two commits, keep changes git reset --hard HEAD~2 # undo last two commits, discard changes Remove a file from git, but keep it locally git reset filename # or git remove --cached filename echo filename >> .gitignore # add it to .gitignore to avoid re-adding it Edit the last commit git commit --amend # start $EDITOR to edit the message git commit --amend -m "New message" # set the new message directly git add forgotten_file git commit --amend View log of commits (with commit Ids) git log Reset to previous commit (Run git log to see Ids!) git reset --hard <some-commit> Reset changes to a particular file git checkout -- ignoreChangesToThisFile.txt Turn it off and on again! rm -fr ~/myrepo/ && git clone myrepo
  • 21. Fin.