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

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"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...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

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.