Git 101: Using version control to manage your code

Welcome, human.

Why are you here?

Suppose you're at the CEEO, working VERY diligently on a project.

As you're progressing through your project, it is natural for you to experiment.

Then you realize, your experiment/the direction you took kinda sucks.

You reach a point where you say "darn.. I wish I saved that earlier version of my project.."

GIT is here to help


No more saving version1.js, version2.js, verison3.js... of your code

Git will help you with keeping track of your revisions. 

More formally, git is a " distributed revision control and source code management (SCM) system" (wikipedia.org). 

More importantly however, git it your friend. 

Basics of git


  1. Where can I get git?
  2. Intro + Basic commands
  3. Remote repositories
  4. Create your own repository
  5. Resources

1. Where can I get git


Windows: 
http://msysgit.github.io/

Mac: 
https://code.google.com/p/git-osx-installer/

Linux:
in terminal: sudo apt-get install git

Please install git on your computer now.

2. Intro + Basic Commands


  • git init - initializes a git repository
  • git add - adds files to your repository
  • git commit - creates a commit. Commits allow git to keep track of your revisions, similar to saving files.
  • git status - shows the status of your git repository (i.e. what files have been changed, what files are not accounted for, etc).

Please create new repositories. This can be for an existing project or a new one.

3. Remote Repositories



github.com

bitbucket.com

4. Create your own Remote repository


Create your own repository on github or bitbucket

This can be for an existing or a new project

More commands:
git clone - clone a remote repository
git pull - pull most recent changes from a repository
git push - push your changes to a repository

5. Resources


Everyday git with 20 commands:

Git tutorial:

Git man page:

CEEO GIT TUtorial

By Rafi Yagudin

CEEO GIT TUtorial

Basics of git

  • 1,173