SlideShare a Scribd company logo
1 of 51
Download to read offline
Start slc
Salt Lake City, UT
January 31st, 2015
Intro to git
PRESENTED
BY
Nina Zakharenko
AND
PART 1
Overview
WHY
USE VERSION CONTROL
COMMITTING
TO YOUR REPOSITORY
GIT
IS NOT GITHUB
REPOSITORY
CREATE YOUR FIRST GIT PROJECT
PART 2
OVERVIEW
FINAL EXERCISEFORKING
(IS NOT A DIRTY WORD)
BRANCHES PULL REQUESTS
SHARING YOUR WORK
?
WHY USE VERSION CONTROL
Have you ever found
yourself creating multiple
versions of a file to “save”
your changes?
!
Do you make multiple
copies of files to make sure
you have a working
backup?
VERSION PROBLEMS
AND VERSIONS ARE ALL OF THEM.
I GOT 99 PROBLEMS
Version Control lets you maintain a history of your files.
!
This history is easily browsed, attached to author names, and logged
with extra commit information.
!
This is especially useful when working in a team environment.
VERSION CONTROL
Git is a tool.
!
More specifically, it’s an open source
distributed version control system with
an emphasis on data integrity and
speed.
GIT IS NOT GITHUB
GIT
github.com is a commercial website
that allows you to host git repositories
!
You can use it to find many open
source projects, and even share your
own.
GIT HUB
You might hear these terms used interchangeably.
They’re not the same!
OUR FIRST repo
LINGO
REPOSITORY
Local Repository - Where code is stored on your local machine
!
Remote Repository - Where code is stored on a remote server
(github, or internal server)
!
Git stores information about the repository in a hidden .git
directory contained in the same folder as the project.
!
Will be commonly referred to as a repo.
!
!
LINGO
CLONE
Copying a github repository to your local machine.
Let’s configure git on our local computer.
!
Use the same email address that your github account is
associated with.
!
$ git config --global user.name "Your Name Here”
!
$ git config --global user.email "your_email@youremail.com"
!
SETTING UP GIT
SET UP
To set up a git repository locally, we navigate via the
command line to the root of our project directory, and
run the command:
!
$ git init
TWO WAYS TO CREATE A REPO
LOCALLY
Log in to your github account.
!
Next, click on the ‘plus’ icon on the right side of the
toolbar, then click new repository.
ON GITHUB
You skip a few setup steps by initializing on github.
GITHUB - CREATE NEW REPO
CLONING OUR NEW REPOSITORY
GET THE URL
CLONE THE PROJECT LOCALLY
EXERCISE
CREATE & CLONE A GITHUB REPO
Creating a fork of my repository will copy it over to your github account.
EXERCISE
1. GO TO GITHUB.COM
Click the plus button on the right hand side, then select new repository.
!
Be aware, public repos are visible on the internet.
2. CREATE A NEW REPOSITORY
Copy the clone URL, then type in :
!
$ git clone <copied_clone_url_here>
3. COPY THE REPO URL, GIT CLONE
COMMITTING
TO YOUR REPOSITORY
LINGO
GIT ADD
$ git add <filename>
!
Git does not automatically keep track of all the files in a project
directory.
!
Use git add to make it aware of a new file, or use git add on an
existing file to let git know you’ve made changes to it that you
want to keep.
LINGO
THE STAGING AREA
When you use $ git add on a file, it gets added to the staging
area.
!
The staging area contains snapshots of files that will be included
in the next commit.
STAGING AREA
Source: 	http://git-scm.com/book/en/v2/Getting-Started-Git-
Basics
LINGO
GIT STATUS
A git command that will give you a status update about your
repository.
!
This is the command I use the most in my day to day git usage.
!
LET’S TRY IT
LINGO
GIT COMMIT
Record a snapshot of the files in the staging area.
!
$ git commit -m “A commit message contains
helpful information”
!
Note: When we run a $ git status after a commit, we’ll see
a message that says “nothing to commit”
LINGO
GIT LOG
A way to see what changes were made, and by who.
!
$ git log	
!
Use $ git diff <filename> to show the difference between
the last checked in version of that file, and the modified file.
LINGO
DIFF
SIDENOTE
WHEN SHOULD I COMMIT MY CODE?
Don’t wait for your code to be a in a perfect state before
committing it.
!
You’ll get the best benefits by committing early & often.
EXERCISE
COMMIT A FILE TO OUR REPO
Using the command line, navigate to the repo directory.
EXERCISE
1. NAVIGATE TO THE REPO
Open the README.md file with your editor of choice. Make and save
changes.
2. MODIFY THE README
Run the command: $ git add README.md
3. ADD FILE TO STAGING AREA
Run the command: $ git status to ensure your file is actually in the staging
4. RUN GIT STATUS
Run the command: $ git commit -m “my commit message”
5. COMMIT YOUR CHANGES
BRANCHES
LINGO
MASTER BRANCH
The master branch is usually the “production ready” version of
your codebase.
!
That means that everything compiles, and all your tests pass. This
is the version that customers will see - even if the customer is just
you.
!
There is only one master branch, and generally code is not
committed directly to it.
LINGO
FEATURE BRANCHES
Branches are extremely useful when you want to work on
different features without interfering with a working copy of the
code.
!
When you’re done working on your feature branch, you can
merge it back into master.
!
If your repository is stored on a remote server, multiple
developers can work on the same branch.
BRANCHES VISUALIZED
source: http://git-scm.com/about
When you create a new branch, you’re automatically
switched to it.
!
$ git checkout -b my_branch_name
USING BRANCHES
CREATE A NEW BRANCH
$ git branch -a
SEE ALL AVAILABLE BRANCHES
$ git checkout my_other_branch
CHECKOUT A DIFFERENT BRANCH
MERGING BRANCHES
MERGE FEATURE BRANCH INTO MASTER
Once you’re satisfied with your feature branch, it’s time to merge
it back into master.
!
$ git checkout master
!
$ git merge my_feature_branch
!
EXERCISE
CREATE A FEATURE BRANCH
$ git checkout -b my_new_branch
EXERCISE
1. CREATE A NEW BRANCH
Review the previous exercise if you need hints.
2. COMMIT CHANGES
3. CHECKOUT MASTER
$ git checkout master
4. MERGE YOUR BRANCH
$ git merge my_new_branch
1
2
34
CREATE A BRANCH
GIT COMMIT
COMMIT TO STAGING
GIT ADD
ADD FILES TO STAGING AREA
WRITE CODE
HACK HACK HACK
5
GIT PUSH
PUSH CHANGES
UP TO REPOSITORY
GIT CHECKOUT -B
GIT WORKFLOW
QUESTIOnS?
COLLABORATING
WITH GITHUB
LINGO
FORK
Forking a repository on github will create a copy of that project
in your github account.
A copy that exists in your GitHub account and can be
used to submit pull requests (changes) to the maintainers
of the project.
FORKING VS CLONING
FORK
A copy that does not exist in your GitHub account, and
cannot change the remote repo unless the person who
cloned it is added as a collaborator on the project.
CLONE
LINGO
PUSH/PULL
PUSH:
Send a copy of the latest committed changes to the remote
server.
!
PULL:
Retrieve a copy of the latest committed changes from the remote
server.
!
Note: If you’re working on a branch with other people, always
run a pull command before getting started.
LINGO
PULL REQUEST
A pull request is a proposal made by you to a project maintainer
asking them to accept your changes to their code base.
!
The maintainer can review a diff of the changes you made.


They can also leave general and code-line specific comments.
FINAL EXERCISE
PULL REQUESTS
https://github.com/nnja/gdi-pull-requests
Creating a fork of my repository will copy it over to your github account.
FINAL EXERCISE - PT1
1. FORK MY REPOSITORY
Go to the github page of your forked copy of gdi-pull-requests.
!
Copy the repository URL, clone the project to your local machine.
2. CLONE YOUR FORKED REPOSITORY
https://github.com/nnja/gdi-pull-requests
git checkout -b <yourname>_branch
3. CREATE A FEATURE BRANCH
Change over to the repository directory.
!
Create a file called <yournamehere>.txt.
FINAL EXERCISE - PT2
4. CREATE A FILE WITH A FUN FACT ABOUT YOU
git add <yourname>.txt
git commit -m “here’s a fun fact about me!”
5. ADD, THEN COMMIT YOUR FILE
https://github.com/nnja/gdi-pull-requests
git push -u origin <yourname>_branch
6. PUSH YOUR BRANCH TO THE REMOTE REPO
FINAL EXERCISE - PT3
7. CREATE A PULL REQUEST
https://github.com/nnja/gdi-pull-requests
FIN
RESOURCES
!
The entire Pro Git e-book.
!
The definitive manual.
!
Dense, time consuming, but
chock full of information.
!
http://git-scm.com/
book/en/v2
!
Short, concise, and visual
guides on beginner to
advanced github topics.
!
https://
guides.github.com/
A 15 minute interactive tutorial.
Bonus: Works in your browser,
no setup required.
!
https://try.github.io/
levels/1/challenges/1
ADDITIONAL
TRY GIT PRO GIT GITHUB GUIDES
THANK YOU
INTRO TO GIT
@nnja
girldevelopit.com

More Related Content

What's hot

Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubNick Quaranto
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Lemi Orhan Ergin
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabShinu Suresh
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAtlassian
 
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...Matt Gauger
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbournePaal Ringstad
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 

What's hot (20)

Git basic
Git basicGit basic
Git basic
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
 
Git
GitGit
Git
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon Melbourne
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Gittalk
GittalkGittalk
Gittalk
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 

Viewers also liked

How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review cultureNina Zakharenko
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + djangoNina Zakharenko
 
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesDjangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesNina Zakharenko
 
Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The BasicsNina Zakharenko
 
Calculo 3 1_ (1)
Calculo 3 1_ (1)Calculo 3 1_ (1)
Calculo 3 1_ (1)deiver1981
 
Продается Yamaha mt-03
Продается Yamaha mt-03Продается Yamaha mt-03
Продается Yamaha mt-03Eugene Skrebanov
 
Huntsville police department interview questions
Huntsville police department interview questionsHuntsville police department interview questions
Huntsville police department interview questionsselinasimpson69
 
Chapter 2 - Atomic structure
Chapter 2 - Atomic structure   Chapter 2 - Atomic structure
Chapter 2 - Atomic structure AZI65
 
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...Julie South
 
루이지엔 3기 포토북
루이지엔 3기 포토북루이지엔 3기 포토북
루이지엔 3기 포토북Louisquartorze
 
DM Lecture 3
DM Lecture 3DM Lecture 3
DM Lecture 3asad199
 
Presenting the fresh, modern style of Hodgson Design Associates
Presenting the fresh, modern style of Hodgson Design AssociatesPresenting the fresh, modern style of Hodgson Design Associates
Presenting the fresh, modern style of Hodgson Design AssociatesHDA-Vancouver
 
Saguenay police department interview questions
Saguenay police department interview questionsSaguenay police department interview questions
Saguenay police department interview questionsselinasimpson69
 
A Graphic Analysis of Adults using Twitter
A Graphic Analysis of Adults using TwitterA Graphic Analysis of Adults using Twitter
A Graphic Analysis of Adults using TwitterAaron Outlen
 
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)Aboubakar Sanfo
 

Viewers also liked (17)

How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review culture
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesDjangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
 
Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The Basics
 
Calculo 3 1_ (1)
Calculo 3 1_ (1)Calculo 3 1_ (1)
Calculo 3 1_ (1)
 
Продается Yamaha mt-03
Продается Yamaha mt-03Продается Yamaha mt-03
Продается Yamaha mt-03
 
Huntsville police department interview questions
Huntsville police department interview questionsHuntsville police department interview questions
Huntsville police department interview questions
 
Chapter 2 - Atomic structure
Chapter 2 - Atomic structure   Chapter 2 - Atomic structure
Chapter 2 - Atomic structure
 
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...
The Power of LinkedIn in Your Business - Reasons To Use LinkedIn for Lead Gen...
 
루이지엔 3기 포토북
루이지엔 3기 포토북루이지엔 3기 포토북
루이지엔 3기 포토북
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled Presentation
 
DM Lecture 3
DM Lecture 3DM Lecture 3
DM Lecture 3
 
Presenting the fresh, modern style of Hodgson Design Associates
Presenting the fresh, modern style of Hodgson Design AssociatesPresenting the fresh, modern style of Hodgson Design Associates
Presenting the fresh, modern style of Hodgson Design Associates
 
Saguenay police department interview questions
Saguenay police department interview questionsSaguenay police department interview questions
Saguenay police department interview questions
 
Format Teks HTML
Format Teks HTMLFormat Teks HTML
Format Teks HTML
 
A Graphic Analysis of Adults using Twitter
A Graphic Analysis of Adults using TwitterA Graphic Analysis of Adults using Twitter
A Graphic Analysis of Adults using Twitter
 
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)
Resultats par secteurs et villages municipales 2016 (pdf 7,2 mo)
 

Similar to Nina Zakharenko - Introduction to Git - Start SLC 2015

3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitRick Umali
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testersupadhyay_25
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with gitJoseluis Laso
 
Git for developers
Git for developersGit for developers
Git for developersHacen Dadda
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03Gourav Varma
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Source control management
Source control managementSource control management
Source control managementOwen Winkler
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboardsDenis Ristic
 
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 GitRobert Lee-Cann
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitLukas Fittl
 

Similar to Nina Zakharenko - Introduction to Git - Start SLC 2015 (20)

Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git hub party-20151008
Git hub party-20151008Git hub party-20151008
Git hub party-20151008
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Git for developers
Git for developersGit for developers
Git for developers
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Git
GitGit
Git
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Source control management
Source control managementSource control management
Source control management
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
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
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
"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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
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
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
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!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
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
 

Nina Zakharenko - Introduction to Git - Start SLC 2015

  • 1. Start slc Salt Lake City, UT January 31st, 2015
  • 3. PART 1 Overview WHY USE VERSION CONTROL COMMITTING TO YOUR REPOSITORY GIT IS NOT GITHUB REPOSITORY CREATE YOUR FIRST GIT PROJECT
  • 4. PART 2 OVERVIEW FINAL EXERCISEFORKING (IS NOT A DIRTY WORD) BRANCHES PULL REQUESTS SHARING YOUR WORK
  • 6. Have you ever found yourself creating multiple versions of a file to “save” your changes? ! Do you make multiple copies of files to make sure you have a working backup? VERSION PROBLEMS AND VERSIONS ARE ALL OF THEM. I GOT 99 PROBLEMS
  • 7. Version Control lets you maintain a history of your files. ! This history is easily browsed, attached to author names, and logged with extra commit information. ! This is especially useful when working in a team environment. VERSION CONTROL
  • 8. Git is a tool. ! More specifically, it’s an open source distributed version control system with an emphasis on data integrity and speed. GIT IS NOT GITHUB GIT github.com is a commercial website that allows you to host git repositories ! You can use it to find many open source projects, and even share your own. GIT HUB You might hear these terms used interchangeably. They’re not the same!
  • 10. LINGO REPOSITORY Local Repository - Where code is stored on your local machine ! Remote Repository - Where code is stored on a remote server (github, or internal server) ! Git stores information about the repository in a hidden .git directory contained in the same folder as the project. ! Will be commonly referred to as a repo. ! !
  • 11. LINGO CLONE Copying a github repository to your local machine.
  • 12. Let’s configure git on our local computer. ! Use the same email address that your github account is associated with. ! $ git config --global user.name "Your Name Here” ! $ git config --global user.email "your_email@youremail.com" ! SETTING UP GIT SET UP
  • 13. To set up a git repository locally, we navigate via the command line to the root of our project directory, and run the command: ! $ git init TWO WAYS TO CREATE A REPO LOCALLY Log in to your github account. ! Next, click on the ‘plus’ icon on the right side of the toolbar, then click new repository. ON GITHUB You skip a few setup steps by initializing on github.
  • 14. GITHUB - CREATE NEW REPO
  • 15. CLONING OUR NEW REPOSITORY GET THE URL CLONE THE PROJECT LOCALLY
  • 16. EXERCISE CREATE & CLONE A GITHUB REPO
  • 17. Creating a fork of my repository will copy it over to your github account. EXERCISE 1. GO TO GITHUB.COM Click the plus button on the right hand side, then select new repository. ! Be aware, public repos are visible on the internet. 2. CREATE A NEW REPOSITORY Copy the clone URL, then type in : ! $ git clone <copied_clone_url_here> 3. COPY THE REPO URL, GIT CLONE
  • 19. LINGO GIT ADD $ git add <filename> ! Git does not automatically keep track of all the files in a project directory. ! Use git add to make it aware of a new file, or use git add on an existing file to let git know you’ve made changes to it that you want to keep.
  • 20. LINGO THE STAGING AREA When you use $ git add on a file, it gets added to the staging area. ! The staging area contains snapshots of files that will be included in the next commit.
  • 22. LINGO GIT STATUS A git command that will give you a status update about your repository. ! This is the command I use the most in my day to day git usage. !
  • 24. LINGO GIT COMMIT Record a snapshot of the files in the staging area. ! $ git commit -m “A commit message contains helpful information” ! Note: When we run a $ git status after a commit, we’ll see a message that says “nothing to commit”
  • 25. LINGO GIT LOG A way to see what changes were made, and by who. ! $ git log !
  • 26. Use $ git diff <filename> to show the difference between the last checked in version of that file, and the modified file. LINGO DIFF
  • 27. SIDENOTE WHEN SHOULD I COMMIT MY CODE? Don’t wait for your code to be a in a perfect state before committing it. ! You’ll get the best benefits by committing early & often.
  • 28. EXERCISE COMMIT A FILE TO OUR REPO
  • 29. Using the command line, navigate to the repo directory. EXERCISE 1. NAVIGATE TO THE REPO Open the README.md file with your editor of choice. Make and save changes. 2. MODIFY THE README Run the command: $ git add README.md 3. ADD FILE TO STAGING AREA Run the command: $ git status to ensure your file is actually in the staging 4. RUN GIT STATUS Run the command: $ git commit -m “my commit message” 5. COMMIT YOUR CHANGES
  • 31. LINGO MASTER BRANCH The master branch is usually the “production ready” version of your codebase. ! That means that everything compiles, and all your tests pass. This is the version that customers will see - even if the customer is just you. ! There is only one master branch, and generally code is not committed directly to it.
  • 32. LINGO FEATURE BRANCHES Branches are extremely useful when you want to work on different features without interfering with a working copy of the code. ! When you’re done working on your feature branch, you can merge it back into master. ! If your repository is stored on a remote server, multiple developers can work on the same branch.
  • 34. When you create a new branch, you’re automatically switched to it. ! $ git checkout -b my_branch_name USING BRANCHES CREATE A NEW BRANCH $ git branch -a SEE ALL AVAILABLE BRANCHES $ git checkout my_other_branch CHECKOUT A DIFFERENT BRANCH
  • 35. MERGING BRANCHES MERGE FEATURE BRANCH INTO MASTER Once you’re satisfied with your feature branch, it’s time to merge it back into master. ! $ git checkout master ! $ git merge my_feature_branch !
  • 37. $ git checkout -b my_new_branch EXERCISE 1. CREATE A NEW BRANCH Review the previous exercise if you need hints. 2. COMMIT CHANGES 3. CHECKOUT MASTER $ git checkout master 4. MERGE YOUR BRANCH $ git merge my_new_branch
  • 38. 1 2 34 CREATE A BRANCH GIT COMMIT COMMIT TO STAGING GIT ADD ADD FILES TO STAGING AREA WRITE CODE HACK HACK HACK 5 GIT PUSH PUSH CHANGES UP TO REPOSITORY GIT CHECKOUT -B GIT WORKFLOW
  • 41. LINGO FORK Forking a repository on github will create a copy of that project in your github account.
  • 42. A copy that exists in your GitHub account and can be used to submit pull requests (changes) to the maintainers of the project. FORKING VS CLONING FORK A copy that does not exist in your GitHub account, and cannot change the remote repo unless the person who cloned it is added as a collaborator on the project. CLONE
  • 43. LINGO PUSH/PULL PUSH: Send a copy of the latest committed changes to the remote server. ! PULL: Retrieve a copy of the latest committed changes from the remote server. ! Note: If you’re working on a branch with other people, always run a pull command before getting started.
  • 44. LINGO PULL REQUEST A pull request is a proposal made by you to a project maintainer asking them to accept your changes to their code base. ! The maintainer can review a diff of the changes you made. 
 They can also leave general and code-line specific comments.
  • 46. Creating a fork of my repository will copy it over to your github account. FINAL EXERCISE - PT1 1. FORK MY REPOSITORY Go to the github page of your forked copy of gdi-pull-requests. ! Copy the repository URL, clone the project to your local machine. 2. CLONE YOUR FORKED REPOSITORY https://github.com/nnja/gdi-pull-requests git checkout -b <yourname>_branch 3. CREATE A FEATURE BRANCH
  • 47. Change over to the repository directory. ! Create a file called <yournamehere>.txt. FINAL EXERCISE - PT2 4. CREATE A FILE WITH A FUN FACT ABOUT YOU git add <yourname>.txt git commit -m “here’s a fun fact about me!” 5. ADD, THEN COMMIT YOUR FILE https://github.com/nnja/gdi-pull-requests git push -u origin <yourname>_branch 6. PUSH YOUR BRANCH TO THE REMOTE REPO
  • 48. FINAL EXERCISE - PT3 7. CREATE A PULL REQUEST https://github.com/nnja/gdi-pull-requests
  • 49. FIN
  • 50. RESOURCES ! The entire Pro Git e-book. ! The definitive manual. ! Dense, time consuming, but chock full of information. ! http://git-scm.com/ book/en/v2 ! Short, concise, and visual guides on beginner to advanced github topics. ! https:// guides.github.com/ A 15 minute interactive tutorial. Bonus: Works in your browser, no setup required. ! https://try.github.io/ levels/1/challenges/1 ADDITIONAL TRY GIT PRO GIT GITHUB GUIDES
  • 51. THANK YOU INTRO TO GIT @nnja girldevelopit.com