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?
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?

Using Git on the Command Line

  • 1.
    It's time totalk about Git and the importance of source control!
  • 2.
    Imagine a scenario,if you will...
  • 3.
    You've uploaded abroken file, you don't have a working copy. What do you do?
  • 4.
    Git to therescue!
  • 5.
    Revert the file,upload it again, and life is great!
  • 6.
  • 10.
    Sounds great, buthow do we use Git?
  • 11.
    If you're intimidatedby the command line, I recommend SourceTree:
  • 12.
    But I promise,using git on the command line is really easy!
  • 13.
    Creating a newrepository is as easy as typing: $ git init This adds the basic structures Git needs in order to function properly
  • 14.
    Cloning an existingrepository 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 toyour repository: $ git add * This will add ALL files in the current directory to your repository.
  • 16.
    Committing a setof 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'sstatus $ git status This reports which files have been modified, added, removed, etc.
  • 18.
    Un-staging some editedfiles: $ 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 stagededits: $ 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 branchback 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 toa remote server: $ git push Yep, that's really all there is to it!
  • 23.