Introduction to GIT

IAG0581
Hannes Kinks

Tallinn, 2015

Version Control System

Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

Goals:

  • Record edits
  • Keep a change history
  • Backup and restore
  • Branching
  • Ease of collaboration

Example software:

  • GIT
  • Subversion (SVN)
  • CVS

GIT

  • Distributed
  • Open-source
  • Scalable
  • Fast
  • Only stores differences between versions

Workflow

  • Clone (copy to local computer)
  • Modify/add/delete files
  • Stage the files
  • Commit locally
  • Push changes to remote repository
     
  • Pull to update local repository

Branching

  • Master - holding the main working version
  • Branching 
    • new features
    • bug fixes
    • trying out things
  • Merge to bring two branches back together

Example

Getting started

Guide to get you started

http://ati.ttu.ee/wiki/index.php/Git_manual

 

Pregenerated repositories for each student

https://git.ttu.ee/ained/iag0581/username.git

 

Downloading GIT at home

http://git-scm.com/downloads

Basic git  commands

git init - create a new repository

git add <filename> - add a file to staging area

git commit -m <comment> - commit changes with comment

git clone <url> - copy repository to local machine

git push - push the changes to remote repository

git pull - update the local repository

GIT introduction

By Hannes Kinks

GIT introduction

Introduction to Git for programming class

  • 616