Problem #1

Code only on one computer

Problem #2

Can't get deleted code back

Old Solutions


  • USB Drive
  • ZIP and Email
  • Dropbox/OneDrive/Google Drive

Git: A Version Control System

Added index.html

Changed  index.html

Added style.css



  • Track and record file changes
  • Compare and analyze code
  • Restore old code
  • Merge code from other computers
  • Merge code from team members

Installing Git


Configuring Git

git config --global "Chris Sevilleja"
git config --global ""

Configuring Git

git config --global "Chris Sevilleja"
git config --global ""



Storage container for our project

Starting a Repo

git init

Git Process

Working Files

Staging Area

Final Commit

Repo Status

git status



A recorded change to the repository

Staging Area


Prepare updated files for commit

Add to Staging

# add all
git add <filename>

# add all
git add -A

Viewing Commits

git log


Remote Repository


A hosted repo not on your current machine.

Remote Repo Benefits


  • Available anywhere
  • Work with team members
  • Code safety (distributed)

Some Choices



Fun Features


  • Contribute to open source projects
  • Try to create a commit streak
  • See all commits
  • See who to blame
  • Analyze a project

SSH Keys


Recommended way of authenticating connections.

How They Work

Your Computer

Private Key


Public Key

Creating an SSH Key

ssh-keygen -t rsa -C ""


Master Branch

New Feature Branch


Viewing Branches

git branch

Creating Branches

git branch my-branch

Switching Branches

git checkout my-branch

Deleting Branches

git branch -d my-branch

Merging Branches

git merge my-branch

Merge Conflict


When git can't automatically merge two branches.


Easy to fix.

Getting Started with Git

By Chris Sevilleja

Getting Started with Git

  • 650
Loading comments...

More from Chris Sevilleja