git heaven with wakanda

40
Git Heaven with Wakanda Juergen Fesslmeier Wakanda Product Manager @chinshr

Upload: juergen-fesslmeier

Post on 25-May-2015

999 views

Category:

Technology


6 download

DESCRIPTION

Git is the new gold standard when it comes to versioning in the Web age. Git is an open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Version control should always be used when doing software development and most open source projects use version control and there is no exception for Wakanda applications. In this session we give an introduction to Git, we explain how to use it with Wakanda, the process of creating and cloning repositories, as well as working with branches in a distributed team environment, and finally dealing with merging source code with your team members.

TRANSCRIPT

Page 1: Git Heaven with Wakanda

Git Heaven with Wakanda

Juergen FesslmeierWakanda Product Manager

@chinshr

Page 2: Git Heaven with Wakanda

About Git

Page 3: Git Heaven with Wakanda

Linus Torvaldshttp://bit.ly/linusongit

Page 4: Git Heaven with Wakanda

“I'm an egotistical bastard, and I name all my projects after myself. First

'Linux', now 'git’.”

Linux Torvalds on Git naming

Page 5: Git Heaven with Wakanda

Projects using Git

• Git• Linux• Perl• Eclipse• Qt• Wakanda

• Rails• Android• PostgreSQL• KDE• Gnome

Page 6: Git Heaven with Wakanda

What is Git?

Page 7: Git Heaven with Wakanda

Git is an open source, distributed

version control system designed

for speed and efficiency.

Page 8: Git Heaven with Wakanda

git-scm.com

Page 9: Git Heaven with Wakanda

Open source: git-scm.com

Page 10: Git Heaven with Wakanda

History of Versioning

Page 11: Git Heaven with Wakanda

Local File System

Page 12: Git Heaven with Wakanda

Local Version Control System

Page 13: Git Heaven with Wakanda

Centralized Version Control

Page 14: Git Heaven with Wakanda

Distributed Version Control

Page 15: Git Heaven with Wakanda

Distributed Version Control

System

Page 16: Git Heaven with Wakanda

Everything is local

(almost)

Page 17: Git Heaven with Wakanda

No Network required

• Create repo• Commit• Merge• Branch• Rebase• Tag

• Status• Revisions• Diff• History• Bisect• Local sync

Page 18: Git Heaven with Wakanda

Advantages

• Everything is fast• Everything is transparent• Every clone is a backup• You can work offline

Page 19: Git Heaven with Wakanda

Designed for Speed and Efficiency

Page 20: Git Heaven with Wakanda

Snapshots, not Patches

Page 21: Git Heaven with Wakanda

Delta vs. Snapshot

Page 22: Git Heaven with Wakanda

How is it different from cvs, svn,

etc.?

Page 23: Git Heaven with Wakanda

Storage vs. Distributed

Page 24: Git Heaven with Wakanda

How do I use Git?

Page 25: Git Heaven with Wakanda

How to Install Git

Installers for Windows, Max, Linuxhttp://git-scm.com

Homebrew on Mac$ brew install git

Apt on Linux$ apt-get install git

Page 26: Git Heaven with Wakanda

Before you start

Configure Git

$ git config --global user.name "Juergen Fesslmeier"

$ git config --global user.email ”[email protected]"

Page 27: Git Heaven with Wakanda

New Project

Create and initialize the Git Directory (.git)

$ mkdir project

$ cd project

$ touch wakanda.js

$ git init

Page 28: Git Heaven with Wakanda

Existing Project

Create and pull down remote repositories.

$ git clone git://github.com/Wakanda/WAF.git

Page 29: Git Heaven with Wakanda

.gitignore

Specify files which will be ignored by Git$ cat .gitignore.DS_Store

data/

temporary files/

Logs/

Build

*.breakpoints

Page 30: Git Heaven with Wakanda

Git staging and status

$ git status# On branch master

#

# Initial commit

#

# Untracked files:

# (use "git add <file>..." to include in what will be committed)

#

# wakanda.js

nothing added to commit but untracked files present (use "git add" to track)

Page 31: Git Heaven with Wakanda

Staging

Stage files to the index.

$ git add .

Page 32: Git Heaven with Wakanda

Committing

Create a commit tagged with a message.

$ git commit -m "first commit"

Page 33: Git Heaven with Wakanda

Remotes

Page 34: Git Heaven with Wakanda

Remote == URL

Protocolsssh://

http[s]://

git://

file://

rsync://

ftp://

Example

[email protected]:Wakanda/WAF.git

https://github.com/Wakanda/WAF.git

git://github.com/Wakanda/WAF.git

Page 35: Git Heaven with Wakanda

Create a remote repository

Create a commit tagged with a message.

•On your own server•github.com•bitbucket.org•beanstalkapp.com•Many more…

Page 36: Git Heaven with Wakanda
Page 37: Git Heaven with Wakanda

Adding remote

Connect your local with a remote repository is called “adding remote”

$ git add remote [email protected]:chinshr/project.git

Page 38: Git Heaven with Wakanda

Project config file

$ cat .git/config[remote "origin"]

url = [email protected]:chinshr/project.git

fetch = +refs/heads/*:refs/remotes/origin/*

Page 39: Git Heaven with Wakanda

Adding remote

Connect your local with a remote repo$ git push -u origin masterCounting objects: 5, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (5/5), 384 bytes, done.

Total 5 (delta 0), reused 0 (delta 0)

To [email protected]:chinshr/project.git

* [new branch] master -> master

Page 40: Git Heaven with Wakanda