git workflows (basics)

51
Git Workflows , and life gets simple again

Upload: roman-kuba

Post on 19-Jun-2015

428 views

Category:

Education


4 download

DESCRIPTION

A Overview on a Basic Git Workflow for beginners and a short outlook to what some approved workflow techniques. Also some Todos included if you want to learn some Basic steps.

TRANSCRIPT

Page 1: Git workflows (Basics)

Git Workflows, and life gets simple again

Page 2: Git workflows (Basics)

whoami

I

Page 3: Git workflows (Basics)

Roman Kuba- FH-Master 2012 - Freelancer - Lead Frontend Dev

@Codeship

- @Codebryo

Page 4: Git workflows (Basics)

Projects

I had the pleasure to work for and with …

Adidas, ServusTV, ORF, APA, David Copperfield, Toursprung, and many more

Page 5: Git workflows (Basics)

Projects

Currently I am working as Lead Frontend Developer at Codeship. (www.codeship.io)

Page 6: Git workflows (Basics)

Tools & Languages

Photoshop, Illustrator, Sketch, JS, CoffeeScript, Sass, Stylus, Jade, Slim, PHP, Ruby, Python, Codeigniter, Laravel, Ruby on Rails, HTML, Sublime Text, Atom, SVN, Git, Jasmin, Cucumber, Spec, Zepto, jQuery, AngularJS, Ember, Knockout, MySQL, PostgreSQL, SQLite, Redis

Page 7: Git workflows (Basics)

Tools & Languages

Photoshop, Illustrator, Sketch, JS, CoffeeScript, Sass, Stylus, Jade, Slim, PHP, Ruby, Python, Codeigniter, Laravel, Ruby on Rails, HTML, Sublime Text, Atom, SVN, Git, Jasmin, Cucumber, Spec, Zepto, jQuery, AngularJS, Ember, Knockout, MySQL, PostgreSQL, SQLite, Redis

Page 8: Git workflows (Basics)

what the git ?

II

Page 9: Git workflows (Basics)

Code Versioning

Page 10: Git workflows (Basics)

Write some Code -> Save it

Change some Code

Delete some Code -> Save it

Oops I need some old code -> Revert it

Do new Stuff -> Save it

Eat some Pizza

Page 11: Git workflows (Basics)

First there was SVN

Page 12: Git workflows (Basics)

First there was SVN

Page 13: Git workflows (Basics)

–Linus Torwalds

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

Page 14: Git workflows (Basics)

–Linus Torwalds

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

an unpleasant or contemptible person.

git

Page 15: Git workflows (Basics)

What to know about Gitlight, easy, robust

branches are gooood

collaboration is awsm

world leader in Software Versioning

Platforms like GitHub, BitBucket, Gitlab, …

Page 16: Git workflows (Basics)

Important Commandspull

add

commit

push

merge

checkout

Page 17: Git workflows (Basics)

example

III

Page 18: Git workflows (Basics)

master

Page 19: Git workflows (Basics)

master

+ README.md add + commit + push

Page 20: Git workflows (Basics)

master

+ Feature start add + commit + push

Page 21: Git workflows (Basics)

master

Page 22: Git workflows (Basics)

master

+ Feature 2 start add + commit + push

Page 23: Git workflows (Basics)

master

2 Features started … bugs ?

Page 24: Git workflows (Basics)

master

2 Features started … bugs ?BAD PRACTICE

Page 25: Git workflows (Basics)

master

Page 26: Git workflows (Basics)

master

+ Feature start add + commit + push

f-a

Page 27: Git workflows (Basics)

master

f-a f-b

+ Feature 2 start add + commit + push

Page 28: Git workflows (Basics)

master

f-a f-b

GOOD PRACTICE

Page 29: Git workflows (Basics)

master

f-a f-b

Page 30: Git workflows (Basics)

master

f-a f-b

+ Feature complete + merge

Page 31: Git workflows (Basics)

master

f-a f-b

+ Feature Ready

Page 32: Git workflows (Basics)

master

f-a f-b

Page 33: Git workflows (Basics)

master

f-a f-b

Page 34: Git workflows (Basics)

master

f-a f-b

Page 35: Git workflows (Basics)
Page 36: Git workflows (Basics)
Page 37: Git workflows (Basics)
Page 38: Git workflows (Basics)

TODO

IV

Page 39: Git workflows (Basics)

Phase 1

Create a Github Account

Download the Github App

Create a new Repository Locally

Add a Project and Push it to Github

Make some changes and Push again

Page 40: Git workflows (Basics)

Phase 2

Create a Branch

Make Changes ( 2 -3 commits ) to the Branch and Publish it

Merge the Branch into Master

Page 41: Git workflows (Basics)

Phase 3

Invite another User to your Project

Checkout the other Project

Make Similar changes to the same file and let the owner push second

Solve the Merge Conflict

Push and be happy

Page 42: Git workflows (Basics)

Advanced

V

Page 43: Git workflows (Basics)

Git Extras

https://github.com/visionmedia/git-extras

Page 44: Git workflows (Basics)

Smart Branching

Create feature and bug branches:

feature/flux-compensator

bug/fix-leaking-on-flux-compensator

Page 45: Git workflows (Basics)

Don't merge alone

Create Pull Requests for your Branches

Page 46: Git workflows (Basics)

but…

you need to use the Terminal ( or other Software ) to have this "smart" branching

Page 47: Git workflows (Basics)

Extras

VI

Page 48: Git workflows (Basics)

It's always worth to git

Git for every project you have.

Page 49: Git workflows (Basics)

Use a good Editor

Have you tried Atom ?

https://atom.io/

Page 50: Git workflows (Basics)

thats just the beginning

Codeship and others help you for the stepsbeyond your git repository

Page 51: Git workflows (Basics)

Questions

VII