SlideShare a Scribd company logo
Getting with GIT 
December 13, 2014 
Moyinoluwa ADEYEMI
Outline 
Outline 
• Introduction (i) 
• Getting Started (i) 
• Introduction (ii) 
• Getting Started (ii) 
• Introduction (iii)
Introduction (i)
Introduction (i) 
Let’s play a little game called Imagine. 
Shall we?
Introduction (i) 
What is Version Control?
Introduction (i) 
Why use a Version Control System? 
• Collaboration 
• Storing versions properly 
• Restoring previous versions 
• Understanding what happened 
• Backup
Introduction (i) 
Types of Version Control Systems 
• Centralized Version Control System (CVCS) 
e.g. Subversion 
• Distributed Version Control System (DVCS) 
e.g. Git
Introduction (i) 
Why Git? 
• Save time 
• Work offline 
• Undo mistakes 
• Make useful commits 
• Work in your own way 
• Don’t mix things up
Getting Started (i)
Getting Started (i) 
How to install Git 
Installing Git on Windows 
• Download the latest version from http://msysgit.github.io/ 
• When installing, choose the default options in each screen 
• Begin work by starting “Git Bash”
Getting Started (i) 
How to install Git 
Installing Git on Mac OS X 
• Download an installer package from https://code.google.com/p/git-osx-installer/ 
downloads/list?can=3/ 
• Begin work by starting “Terminal.app”.
Getting Started (i) 
How to install Git 
Installing Git on Linux 
• On Fedora use: 
sudo yum install git 
• On a Debian-based distribution like Ubuntu, use apt to update your local 
package index. You can then download and install the program: 
sudo apt-get update 
sudo apt-get install git
Getting Started (i) 
Configuring Git 
• Set your name 
$ git config --global user.name “Jane Doe” 
• Set your email address 
$ git config --global user.email “jane@doe.org” 
• Enable coloring? 
$ git config --global color.ui auto
Introduction (ii)
Introduction (ii) 
• Repository 
A place where the history of your work is stored. It lives in a .git folder in 
the root directory of your project. 
• Types 
Local Repository – Resides on your local computer 
Remote Repository – Located on a remote server on the internet
Introduction (ii) 
Repository registers 
• Clone 
Creates a “copy” of a repository 
• Fork 
Clone a remote repository. Create a copy that you can modify 
independently 
• Star 
Keep track of interesting projects
Introduction (ii) 
Repository registers 
• Untracked files 
• Tracked files 
• Working copy 
• Staging area
Introduction (ii)
Introduction (ii) 
Some Git commands 
• Init - $ git init 
• Add - $ git add -<file> 
• Commit - $ git commit -m “Commit message” 
• Status - $ git status 
• Log - $ git log
Getting Started (ii)
Getting Started (ii) 
Starting with an unversioned project 
• Change into the project’s root folder on the command line. 
$ cd path/to/project 
• Use the “git init” command to version the project. $ git init 
Notice the .git subdirectory? To help you understand what’s going on, check the status 
of your repo ($ git status) after typing any command.
Getting Started (ii) 
Starting with an unversioned project 
• Add a file to your project folder. Check the status. 
• Use the “git add” command to track this file 
$ git add gdaysdemo.html 
• Use “git commit” to commit the file 
$ git commit –m “Initial commit” 
• Use “git log” to check the changes that happened in the commit 
$ git log –p
Getting Started (ii) 
Pushing an existing project to GitHub 
• Login/Signup to GitHub to create a repo. 
• Add remote origin in your local project folder (the same as the last one used) 
$ git remote add origin https://github.com/<username>/<projectname>.git 
• Push to GitHub 
$ git push –u origin master
Getting Started (ii) 
Starting with an existing project 
• Navigate to https://github.com/moyheen 
• Clone the gdaysnigeria2014 repo. Make sure that you are in the folder where you 
want this project to be downloaded to. 
• Create a file (please name it with your github username), stage and commit it. 
• Use “git push origin” to push the file to the remote repo and use “git log” to 
monitor your commits.
Getting Started (ii) 
You are the real MVP! 
You just learnt the basics of version control with GIT. 
(y)
Introduction (iii)
Introduction(iii) 
• Branches 
• Working with branches 
• Saving changes temporarily 
• Checking out a local branch 
• Merging changes
Introduction(iii) 
Branches are the perfect tool to help you avoid mixing up different lines of 
development.
Introduction(iii) 
Branches gives you the ability to work on different things in parallel, leaving you with 
at least one context for the “main” or “production” state, and another context for each 
feature.
Introduction(iii) 
Working with branches 
• The currently active, or “checked out”, or “HEAD” branch 
• Branch master 
• Creating a new branch - $ git branch <branchname> 
• $ git branch -v
Introduction(iii) 
Saving changes temporarily 
• The Stash 
• Stashing a local change - $ git stash 
• Get an overview of current stashes- $ git stash list 
• Restore a saved stash. 
“git stash pop” will apply the newest stash and clear it from the stash 
clipboard. 
“git stash apply <stashname>” will apply the specified stash but it will 
remain saved.
Introduction(iii) 
When to stash 
• Before checking out a different branch 
• Before pulling remote changes 
• Before merging a branch
Introduction(iii) 
• Checking out a local branch 
$ git checkout <branchname> 
• Merging changes 
$ git merge <branchname> 
First checkout the branch that should receive the changes 
Call “git merge” with the name of the branch that contains the desired changes
Introduction(iii) 
• Merge conflicts 
$ git status 
On branch <branchname> 
You have unmerged paths.
Introduction(iii) 
After solving all conflicts, a merge conflict needs to be concluded by a “git add” (if merge is 
done by hand and 
not with a merge tool) and a regular commit. 
Undoing a Merge with “git merge --abort” 
Use “git reset --hard” to roll back to the commit before the merge happened.
The ebook at http://www.git-tower.com/learn/ebook/command-line aided the 
preparation of this slide.
Thank You 
Moyinoluwa Adeyemi 
Obafemi Awolowo University 
Twitter - @moyheen 
LinkedIn - ng.linkedin.com/in/moyheen/ 
Gmail - moyinoluwaa@gmail.com

More Related Content

What's hot

Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Randal Schwartz
 
Git ritesh venture_pact
Git ritesh venture_pactGit ritesh venture_pact
Git ritesh venture_pact
riteshtandon23
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
"FENG "GEORGE"" YU
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
TingYen Lee
 
GIT | Distributed Version Control System
GIT | Distributed Version Control SystemGIT | Distributed Version Control System
GIT | Distributed Version Control System
Mohammad Imam Hossain
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
Salvatore Cordiano
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
聖文 鄭
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
mwrather
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
Lorna Mitchell
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
Prem Aseem Jain
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Git & Github @ ROSEdu CDL
Git & Github @ ROSEdu CDLGit & Github @ ROSEdu CDL
Git & Github @ ROSEdu CDL
Alex Palcuie
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil Ali
AmilAli1
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
Nishan Bose
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Houari ZEGAI
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Shilu Shrestha
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 

What's hot (20)

Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git ritesh venture_pact
Git ritesh venture_pactGit ritesh venture_pact
Git ritesh venture_pact
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
 
GIT | Distributed Version Control System
GIT | Distributed Version Control SystemGIT | Distributed Version Control System
GIT | Distributed Version Control System
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git & Github @ ROSEdu CDL
Git & Github @ ROSEdu CDLGit & Github @ ROSEdu CDL
Git & Github @ ROSEdu CDL
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil Ali
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git basics
Git basicsGit basics
Git basics
 

Similar to Getting with GIT

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
Arashdeepkaur16
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
Grace Chien
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
HELLOWorld889594
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
WSO2
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
ssusered2ec2
 
Demo
DemoDemo
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
 
Gitting the Most From Git
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
Chris Miller
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
 

Similar to Getting with GIT (20)

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
 
11 git version control
11 git version control11 git version control
11 git version control
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
 
Demo
DemoDemo
Demo
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Gitting the Most From Git
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
 
Learning git
Learning gitLearning git
Learning git
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 

Recently uploaded

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

Getting with GIT

  • 1. Getting with GIT December 13, 2014 Moyinoluwa ADEYEMI
  • 2. Outline Outline • Introduction (i) • Getting Started (i) • Introduction (ii) • Getting Started (ii) • Introduction (iii)
  • 4. Introduction (i) Let’s play a little game called Imagine. Shall we?
  • 5. Introduction (i) What is Version Control?
  • 6. Introduction (i) Why use a Version Control System? • Collaboration • Storing versions properly • Restoring previous versions • Understanding what happened • Backup
  • 7. Introduction (i) Types of Version Control Systems • Centralized Version Control System (CVCS) e.g. Subversion • Distributed Version Control System (DVCS) e.g. Git
  • 8. Introduction (i) Why Git? • Save time • Work offline • Undo mistakes • Make useful commits • Work in your own way • Don’t mix things up
  • 10. Getting Started (i) How to install Git Installing Git on Windows • Download the latest version from http://msysgit.github.io/ • When installing, choose the default options in each screen • Begin work by starting “Git Bash”
  • 11. Getting Started (i) How to install Git Installing Git on Mac OS X • Download an installer package from https://code.google.com/p/git-osx-installer/ downloads/list?can=3/ • Begin work by starting “Terminal.app”.
  • 12. Getting Started (i) How to install Git Installing Git on Linux • On Fedora use: sudo yum install git • On a Debian-based distribution like Ubuntu, use apt to update your local package index. You can then download and install the program: sudo apt-get update sudo apt-get install git
  • 13. Getting Started (i) Configuring Git • Set your name $ git config --global user.name “Jane Doe” • Set your email address $ git config --global user.email “jane@doe.org” • Enable coloring? $ git config --global color.ui auto
  • 15. Introduction (ii) • Repository A place where the history of your work is stored. It lives in a .git folder in the root directory of your project. • Types Local Repository – Resides on your local computer Remote Repository – Located on a remote server on the internet
  • 16. Introduction (ii) Repository registers • Clone Creates a “copy” of a repository • Fork Clone a remote repository. Create a copy that you can modify independently • Star Keep track of interesting projects
  • 17. Introduction (ii) Repository registers • Untracked files • Tracked files • Working copy • Staging area
  • 19. Introduction (ii) Some Git commands • Init - $ git init • Add - $ git add -<file> • Commit - $ git commit -m “Commit message” • Status - $ git status • Log - $ git log
  • 21. Getting Started (ii) Starting with an unversioned project • Change into the project’s root folder on the command line. $ cd path/to/project • Use the “git init” command to version the project. $ git init Notice the .git subdirectory? To help you understand what’s going on, check the status of your repo ($ git status) after typing any command.
  • 22. Getting Started (ii) Starting with an unversioned project • Add a file to your project folder. Check the status. • Use the “git add” command to track this file $ git add gdaysdemo.html • Use “git commit” to commit the file $ git commit –m “Initial commit” • Use “git log” to check the changes that happened in the commit $ git log –p
  • 23. Getting Started (ii) Pushing an existing project to GitHub • Login/Signup to GitHub to create a repo. • Add remote origin in your local project folder (the same as the last one used) $ git remote add origin https://github.com/<username>/<projectname>.git • Push to GitHub $ git push –u origin master
  • 24. Getting Started (ii) Starting with an existing project • Navigate to https://github.com/moyheen • Clone the gdaysnigeria2014 repo. Make sure that you are in the folder where you want this project to be downloaded to. • Create a file (please name it with your github username), stage and commit it. • Use “git push origin” to push the file to the remote repo and use “git log” to monitor your commits.
  • 25. Getting Started (ii) You are the real MVP! You just learnt the basics of version control with GIT. (y)
  • 27. Introduction(iii) • Branches • Working with branches • Saving changes temporarily • Checking out a local branch • Merging changes
  • 28. Introduction(iii) Branches are the perfect tool to help you avoid mixing up different lines of development.
  • 29. Introduction(iii) Branches gives you the ability to work on different things in parallel, leaving you with at least one context for the “main” or “production” state, and another context for each feature.
  • 30. Introduction(iii) Working with branches • The currently active, or “checked out”, or “HEAD” branch • Branch master • Creating a new branch - $ git branch <branchname> • $ git branch -v
  • 31. Introduction(iii) Saving changes temporarily • The Stash • Stashing a local change - $ git stash • Get an overview of current stashes- $ git stash list • Restore a saved stash. “git stash pop” will apply the newest stash and clear it from the stash clipboard. “git stash apply <stashname>” will apply the specified stash but it will remain saved.
  • 32. Introduction(iii) When to stash • Before checking out a different branch • Before pulling remote changes • Before merging a branch
  • 33. Introduction(iii) • Checking out a local branch $ git checkout <branchname> • Merging changes $ git merge <branchname> First checkout the branch that should receive the changes Call “git merge” with the name of the branch that contains the desired changes
  • 34. Introduction(iii) • Merge conflicts $ git status On branch <branchname> You have unmerged paths.
  • 35. Introduction(iii) After solving all conflicts, a merge conflict needs to be concluded by a “git add” (if merge is done by hand and not with a merge tool) and a regular commit. Undoing a Merge with “git merge --abort” Use “git reset --hard” to roll back to the commit before the merge happened.
  • 36. The ebook at http://www.git-tower.com/learn/ebook/command-line aided the preparation of this slide.
  • 37. Thank You Moyinoluwa Adeyemi Obafemi Awolowo University Twitter - @moyheen LinkedIn - ng.linkedin.com/in/moyheen/ Gmail - moyinoluwaa@gmail.com

Editor's Notes

  1. For Fedora users, you might need to install ‘epel.repo’ before installing git. Find it here -> (https://fedoraproject.org/wiki/EPEL)