• No results found

Lec 23 - Introduction to GIT HUB.pdf

N/A
N/A
Protected

Academic year: 2020

Share "Lec 23 - Introduction to GIT HUB.pdf"

Copied!
35
0
0

Loading.... (view fulltext now)

Full text

(1)

Nicolás Tourné @nicotourne CTO of BeeReal

Tandil, Argentina - 2013

#BeeTalks

(2)

Agenda

What’s a Version Control System?

What the heck is Git?

Some Git commands

What’s about GitHub?

(3)

What’s a Version Control System?

“An application that allows you to

(4)

Why do I need that?

Makes it way easier to undo errors / roll

back to earlier versions of code

Makes it way easier to share a codebase

between developers without creating conflicts

Makes it way easier to deploy changes

(5)

Popular Version Control Systems

CVS - Concurrent Version System

SVN - SubVersioN

Git

Mercurial

Bazaar

(6)

What the heck is Git?

Distributed Source Control system

Open source, free (GNU GPL V2)

Originally developed by Linus Torvalds for

the development of the Linux Kernel in 2005

Focus on speed and efficiency

Quite a unique design and therefore

(7)

Save snapshots, no differences

Branching (lightweight & fast)

Automatic merge of files

Used on personal or very large projects, and

for all size of teams

(8)

Distributed Development

Every Git working directory contains the

complete repository and history and full revision tracking capabilities

You’re not dependent on a central server

and you don’t have to be online

It’s extremely fast - much faster than SVN,

(9)

Centralized vs Distributed

Development

SVN / CVS - Centralized development

John

Central

(10)

Git - Distributed development

Centralized vs Distributed

Development

John

Peter

Bob

Carl

(11)

A Git Sample

1. A new git is initialized as a remote repository

John Remote repository Peter

master

(12)

A Git Sample

2. John and Peter clone the git repository

John Remote repository Peter

master

C0

master

C0

master

(13)

A Git Sample

3. John does a commit

John Remote repository Peter

master

C1

master

C0

master

C0

(14)

A Git Sample

4. John does a push

John Remote repository Peter

master

C1

master

C0

C0

master

C1

(15)

A Git Sample

5. Peter does a pull

John Remote repository Peter

master

C1

master

C1

C0

master

C1

(16)

A Git Sample

6. John does a commit & push

John Remote repository Peter

master

C2

master

C1

C1

master

C2

C0 C0

(17)

A Git Sample

7. Peter does a commit

John Remote repository Peter

master

C2

master

C3

C1

master

C2

C1 C1

(18)

A Git Sample

8. Peter does a pull (fetch & merge)

John Remote repository Peter

master C2 master C2 C1 master C2 C1 C1

C0 C0

(19)

A Git Sample

9. Peter does a push

John Remote repository Peter

master C2 master C2 C1 master C4 C1

C0 C1

C0 C3 C4

C2 C3

(20)

A Git Sample

10. John does a pull

John Remote repository Peter

master C4 master C2 master C4 C1

C1 C1

C0 C3 C4

C2 C3

C0

C2 C3

(21)

Git Commands

Getting and Creating projects

init

To create a git repository from an existing directory of files

$ git init

clone

If you want to get a copy of a project, you need to clone it

(22)

Git Commands

Basic Snapshotting

git add

You have to add file contents to your staging area before you can commit them

$ git add index.php

git status

View the status of your files in the working directory and staging area

(23)

Git Commands

Basic Snapshotting

git diff

Shows diff of what is staged and what is modified but unstaged

$ git diff

git commit

Records a snapshot of the staging area

(24)

Git Commands

Basic Snapshotting

git reset

Undo changed and commits

$ git reset

git rm

Remove files from the staging area

(25)

Git Commands

Basic Snapshotting

git mv

Git doesn’t track file renames

$ git mv index.php index.html

git stash

Save changes made in the current index and working directory for later

(26)

Git Commands

Branching and Merging

git branch

List, create and manage branches

$ git branch

$ git branch QA

git checkout

Switch to a new branch context

$ git checkout QA

(27)

Git Commands

Branching and Merging

git merge

Merge a branch context into your current one

$ git branch $ git merge QA

git log

Show commit history of a branch

(28)

Git Commands

Branching and Merging

git tag

Tag a point in history as important

(29)

Git Commands

Sharing and Updating Projects

git fetch

Download new branches and data from remote repository

$ git fetch

git pull

Fetch from a remote repo and try to merge into the current branch

(30)

Git Commands

Sharing and Updating Projects

git push

Push your new branches and data to a remote repository

(31)

What's about GitHub?

It’s a Git repository hosting service… but it

adds many of its own features

While Git is a command line tool, GitHub

provides a web-based graphical interface

It also provides access control and several

(32)

What's about GitHub?

By default, all projects are public and free. In

you want a private project, then pay

You can clone any public repository, follow

projects and developers, post comments, etc

(33)

Git in Action!

Go to your computer and start playing...

1. Create a new repository on GitHub 2. Clone this repository

3. Add new files

4. Commit and push them

(34)

Thank you

for your attention!

Questions?

Just tweet me @nicotourne

or mail me at [email protected]

(35)

More info at...

Official Git site

http://git-scm.com

Some slides

http://www.slideshare.net/jomikr/quick-introduction-to-git

http://www.slideshare.net/reallyordinary/intro-to-git-for-drupal-7 http://www.slideshare.net/anildigital/git-introduction

http://www.slideshare.net/chacon/getting-git

Git commands

http://gitref.org/basic

GitHub site

References

Related documents

• Digitize the mold of the amputee stump by Renishaw Cylone Digitizer with reverse engineering. This process is to scan and digitize the actual mold of the amputee

The aim of the thesis is to log real world sensory data from multiple sensors on board mobile devices and develop suitable algorithms to extract information from the data to solve

As Hedge Funds become an increasingly popular investment choice and increased regulation seems inevitable, Hedge Fund Managers need to have a comprehensive risk management

Jardine Lloyd Thompson Group plc is quoted on the FTSE250 index of the London Stock exchange and is one of the world’s largest providers of insurance, reinsurance and employee

Consumer Advocate, Steve Burgess, following recent rate filings by leading medical malpractice insurers writing in Florida. The Office conducted the hearing in Tallahassee, Florida

The influx of new capital and the growing embeddedness of this capital in the reinsurance space have spurred confidence in the market environment allowing many companies to

At the same time, our approach allows our local marketers, working with our Global Markets team, to benefit from relationships with global carriers built on the strength of our

The main purpose of this study was to investigate the impact of training and development on Employee Performance and Productivity in United Banks Limited (UBL)..