SlideShare a Scribd company logo
It's time to talk about Git
and the importance of
source control!
Imagine a scenario, if
you will...
You've uploaded a broken file,
you don't have a working copy.
What do you do?
Git to the rescue!
Revert the file, upload it
again, and life is great!
Wow! How does
Git work?
Using Git on the Command Line
Using Git on the Command Line
Using Git on the Command Line
Sounds great, but how
do we use Git?
If you're intimidated by the command line,
I recommend SourceTree:
But I promise, using git
on the command line is
really easy!
Creating a new repository
is as easy as typing:
$ git init
This adds the basic structures Git needs
in order to function properly
Cloning an existing repository
is just as easy:
$ git clone <repo url>
This pulls down the entire git history for
a given project and lets you manipulate
it as if you had created it.
Adding files to your repository:
$ git add *
This will add ALL files in the current
directory to your repository.
Committing a set of changes:
$ git commit -m "My commit message"
This will save all staged changes to a
reference point you can always restore.
Checking a repository's status
$ git status
This reports which files have been
modified, added, removed, etc.
Un-staging some edited files:
$ git reset
This returns all staged files back to
being unstaged. It does NOT undo any
edits to those files by default.
Temporarily store staged edits:
$ git stash
Think of this as a way of saying, "I'm not
ready to do anything with these edits,
but I don't want to erase them."
Start a new "branch" for tracking edits:
$ git branch mybranch
We'll use this separate branch to
develop a new feature, safely isolated
from the main codebase and bug fixes.
$ git checkout -b mybranch
–or–
Merge a branch back into master:
$ git checkout master
$ git merge mybranch
First we switch back to the master
branch, then we merge in all changes
from mybranch.
Pushing Edits to a remote server:
$ git push
Yep, that's really all there is to it!
Any Questions?

More Related Content

PDF
Git in pills : git stash
PDF
How to become a Git power user
PDF
PDF
Introduction to Git for Artists
PPTX
Version control system & how to use git
PDF
Git introduction
PDF
Git essentials
PDF
VersionEEring
Git in pills : git stash
How to become a Git power user
Introduction to Git for Artists
Version control system & how to use git
Git introduction
Git essentials
VersionEEring

What's hot (12)

KEY
Git Distributed Version Control System
ODP
Haystack
PPT
Git Cards - Keynote Format
PDF
Git basic and workflow
PDF
Kitchen Design Guide - Consumer Reports
PDF
Undoing Things in Git
PDF
Git training cheat sheet
PPTX
Git missiontomars 2015-03-10
PDF
Atomic Designは「マルチ」で真価を発揮する
PPTX
Git lord | A brief intro about git commands in Star Wars theme
PDF
Don't fear the rebase
DOCX
Hola mundo12
Git Distributed Version Control System
Haystack
Git Cards - Keynote Format
Git basic and workflow
Kitchen Design Guide - Consumer Reports
Undoing Things in Git
Git training cheat sheet
Git missiontomars 2015-03-10
Atomic Designは「マルチ」で真価を発揮する
Git lord | A brief intro about git commands in Star Wars theme
Don't fear the rebase
Hola mundo12
Ad

Viewers also liked (20)

PDF
Code Refactoring - Live Coding Demo (JavaDay 2014)
PPT
Creating Custom Drupal Modules
PDF
TMS - Schedule of Presentations and Reports
PDF
FLTK Summer Course - Part III - Third Impact
PPT
Introduction to Git Commands and Concepts
PDF
Git hooks For PHP Developers
PDF
FLTK Summer Course - Part VIII - Eighth Impact
PPTX
Manipulating file in Python
PDF
"Git Hooked!" Using Git hooks to improve your software development process
PDF
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
PDF
FLTK Summer Course - Part VI - Sixth Impact - Exercises
PDF
Blisstering drupal module development ppt v1.2
PDF
Advanced Git
PDF
FLTK Summer Course - Part I - First Impact - Exercises
PDF
FLTK Summer Course - Part II - Second Impact
ODP
Servicios web con Python
PDF
FLTK Summer Course - Part II - Second Impact - Exercises
PDF
FLTK Summer Course - Part VII - Seventh Impact
PPT
13 Graph Classes
PPT
Minimal standard c program
Code Refactoring - Live Coding Demo (JavaDay 2014)
Creating Custom Drupal Modules
TMS - Schedule of Presentations and Reports
FLTK Summer Course - Part III - Third Impact
Introduction to Git Commands and Concepts
Git hooks For PHP Developers
FLTK Summer Course - Part VIII - Eighth Impact
Manipulating file in Python
"Git Hooked!" Using Git hooks to improve your software development process
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
FLTK Summer Course - Part VI - Sixth Impact - Exercises
Blisstering drupal module development ppt v1.2
Advanced Git
FLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part II - Second Impact
Servicios web con Python
FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part VII - Seventh Impact
13 Graph Classes
Minimal standard c program
Ad

Similar to Using Git on the Command Line (20)

PDF
WPGR - Intro to Git (on the Command Line)
DOCX
Git github
PDF
Git slides
PPTX
Hacktoberfest intro to Git and GitHub
PPTX
Git 101 - An introduction to Version Control using Git
PPTX
Mastering GIT
PPTX
Git tips
PDF
Git cheat sheet__grey
PDF
Git cheat sheet__white
PDF
Git cheat sheet_dark
PPTX
Introduction To Git Workshop
PDF
Git Init (Introduction to Git)
PDF
git-commands-cheat-sheet-infopediya-com.pdf
PDF
Collaborative development with Git | Workshop
PPTX
Use Git like a pro - condensed
PPTX
Git - Simplified For Testers
PDF
How to Really Get Git
PDF
Git and Version Control at Atlogys
PDF
Git Commands for Test Automation: Best Practices & Techniques
PDF
Version Control Systems Software Engineering
WPGR - Intro to Git (on the Command Line)
Git github
Git slides
Hacktoberfest intro to Git and GitHub
Git 101 - An introduction to Version Control using Git
Mastering GIT
Git tips
Git cheat sheet__grey
Git cheat sheet__white
Git cheat sheet_dark
Introduction To Git Workshop
Git Init (Introduction to Git)
git-commands-cheat-sheet-infopediya-com.pdf
Collaborative development with Git | Workshop
Use Git like a pro - condensed
Git - Simplified For Testers
How to Really Get Git
Git and Version Control at Atlogys
Git Commands for Test Automation: Best Practices & Techniques
Version Control Systems Software Engineering

More from Brian Richards (6)

PDF
Awarding Behavior & Altering Businesses with WordPress
PDF
Becoming a Better Developer #WCA2
PDF
Learn Something Useful Every Day
PDF
I Don't Hate You, I Just Hate Your Code
PDF
Using a Framework Won't Box You In
KEY
Developing for Success -or- Any Fool Can Do This
Awarding Behavior & Altering Businesses with WordPress
Becoming a Better Developer #WCA2
Learn Something Useful Every Day
I Don't Hate You, I Just Hate Your Code
Using a Framework Won't Box You In
Developing for Success -or- Any Fool Can Do This

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Online Work Permit System for Fast Permit Processing
PDF
AI in Product Development-omnex systems
PPTX
L1 - Introduction to python Backend.pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
medical staffing services at VALiNTRY
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Transform Your Business with a Software ERP System
top salesforce developer skills in 2025.pdf
Odoo POS Development Services by CandidRoot Solutions
2025 Textile ERP Trends: SAP, Odoo & Oracle
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Wondershare Filmora 15 Crack With Activation Key [2025
Understanding Forklifts - TECH EHS Solution
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Online Work Permit System for Fast Permit Processing
AI in Product Development-omnex systems
L1 - Introduction to python Backend.pptx
ai tools demonstartion for schools and inter college
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Softaken Excel to vCard Converter Software.pdf
ISO 45001 Occupational Health and Safety Management System
Transform Your Business with a Software ERP System

Using Git on the Command Line

  • 1. It's time to talk about Git and the importance of source control!
  • 2. Imagine a scenario, if you will...
  • 3. You've uploaded a broken file, you don't have a working copy. What do you do?
  • 4. Git to the rescue!
  • 5. Revert the file, upload it again, and life is great!
  • 10. Sounds great, but how do we use Git?
  • 11. If you're intimidated by the command line, I recommend SourceTree:
  • 12. But I promise, using git on the command line is really easy!
  • 13. Creating a new repository is as easy as typing: $ git init This adds the basic structures Git needs in order to function properly
  • 14. Cloning an existing repository is just as easy: $ git clone <repo url> This pulls down the entire git history for a given project and lets you manipulate it as if you had created it.
  • 15. Adding files to your repository: $ git add * This will add ALL files in the current directory to your repository.
  • 16. Committing a set of changes: $ git commit -m "My commit message" This will save all staged changes to a reference point you can always restore.
  • 17. Checking a repository's status $ git status This reports which files have been modified, added, removed, etc.
  • 18. Un-staging some edited files: $ git reset This returns all staged files back to being unstaged. It does NOT undo any edits to those files by default.
  • 19. Temporarily store staged edits: $ git stash Think of this as a way of saying, "I'm not ready to do anything with these edits, but I don't want to erase them."
  • 20. Start a new "branch" for tracking edits: $ git branch mybranch We'll use this separate branch to develop a new feature, safely isolated from the main codebase and bug fixes. $ git checkout -b mybranch –or–
  • 21. Merge a branch back into master: $ git checkout master $ git merge mybranch First we switch back to the master branch, then we merge in all changes from mybranch.
  • 22. Pushing Edits to a remote server: $ git push Yep, that's really all there is to it!