git heaven with wakanda

Post on 25-May-2015

999 Views

Category:

Technology

6 Downloads

Preview:

Click to see full reader

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

Git Heaven with Wakanda

Juergen FesslmeierWakanda Product Manager

@chinshr

About Git

Linus Torvaldshttp://bit.ly/linusongit

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

'Linux', now 'git’.”

Linux Torvalds on Git naming

Projects using Git

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

• Rails• Android• PostgreSQL• KDE• Gnome

What is Git?

Git is an open source, distributed

version control system designed

for speed and efficiency.

git-scm.com

Open source: git-scm.com

History of Versioning

Local File System

Local Version Control System

Centralized Version Control

Distributed Version Control

Distributed Version Control

System

Everything is local

(almost)

No Network required

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

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

Advantages

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

Designed for Speed and Efficiency

Snapshots, not Patches

Delta vs. Snapshot

How is it different from cvs, svn,

etc.?

Storage vs. Distributed

How do I use Git?

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

Before you start

Configure Git

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

$ git config --global user.email ”j@4d.com"

New Project

Create and initialize the Git Directory (.git)

$ mkdir project

$ cd project

$ touch wakanda.js

$ git init

Existing Project

Create and pull down remote repositories.

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

.gitignore

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

data/

temporary files/

Logs/

Build

*.breakpoints

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)

Staging

Stage files to the index.

$ git add .

Committing

Create a commit tagged with a message.

$ git commit -m "first commit"

Remotes

Remote == URL

Protocolsssh://

http[s]://

git://

file://

rsync://

ftp://

Example

git@github.com:Wakanda/WAF.git

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

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

Create a remote repository

Create a commit tagged with a message.

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

Adding remote

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

$ git add remote git@github.com:chinshr/project.git

Project config file

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

url = git@github.com:chinshr/project.git

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

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 git@github.com:chinshr/project.git

* [new branch] master -> master

top related