git preso to valtech cfml team

49
Open Source Collaboration with Git and GitHub SaravanaMuthu Aka CF Mitrah. Shamelessly copied slides from other presentations.

Upload: saravanamuthu-jayaraj

Post on 16-Jul-2015

74 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Git preso to valtech cfml team

Open Source Collaboration with Git and GitHub

SaravanaMuthu Aka CF Mitrah.

Shamelessly copied slides from other presentations.

Page 2: Git preso to valtech cfml team

DisclaimerI am a hardcore ColdFusion Developer

I’m not a Git expert or pro

Page 3: Git preso to valtech cfml team

No Source Control System =

Page 4: Git preso to valtech cfml team

This is also not source control...

Page 5: Git preso to valtech cfml team

Why you need it•Your code will break (and you won't know why)

•Your hard drive will die

•Taking latest files from FTP is pain

Why you think you don't need it and are wrong•I work alone (you will break your own code)

•My project is small

(projects grow – Facebook used to be 5 files)

Page 6: Git preso to valtech cfml team

Centralized

Page 7: Git preso to valtech cfml team

Centralized Version Control

• Traditional version control system– Server with database– Clients have a working version

• Examples– CVS– Subversion– Visual Source Safe

• Challenges– Multi-developer conflicts– Client/server communication

Page 8: Git preso to valtech cfml team

Centralized Version Control :: Cons

Page 9: Git preso to valtech cfml team

Distributed Version Control

Page 10: Git preso to valtech cfml team

Distributed Version Control

• Authoritative server by convention only

• Every working checkout is a repository

• Get version control even when detached

• Backups are trivial

• Other distributed systems include– Mercurial

– BitKeeper

– Darcs

– Bazaar

Page 11: Git preso to valtech cfml team
Page 12: Git preso to valtech cfml team

I'm an egoistical bastard, and I name all my projects after myself.

First Linux, now git.

-Linus Torvalds

Page 13: Git preso to valtech cfml team
Page 14: Git preso to valtech cfml team
Page 15: Git preso to valtech cfml team
Page 16: Git preso to valtech cfml team

And Now

Page 17: Git preso to valtech cfml team

Git Advantages• Resilience

– No one repository has more data than any other

• Speed– Very fast operations compared to other VCS (I’m looking at you CVS

and Subversion)

• Space– Compression can be done across repository not just per file– Minimizes local size as well as push/pull data transfers

• Simplicity– Object model is very simple

• Large user base with robust tools

Page 18: Git preso to valtech cfml team

1. Fast

Page 19: Git preso to valtech cfml team

Local

2. Local

Page 20: Git preso to valtech cfml team

Distributed

3. Distributed

Page 21: Git preso to valtech cfml team

3. Cheap Branching

Page 22: Git preso to valtech cfml team

Branching

Page 23: Git preso to valtech cfml team

Any Workflow

4.Many Workflows

Page 24: Git preso to valtech cfml team

Failboat.

It’s not perfect.

Page 25: Git preso to valtech cfml team

The downsides

• Complexity• Windows FTL• What's an IDE? (but see egit for Eclipse, plus

Vim and Emacs support, and GUIs)• Still frequent releases

•Cygwin – build yourself•Ubuntu – use Git PPA

Page 26: Git preso to valtech cfml team

The Staging Area

Page 27: Git preso to valtech cfml team

Integration Manager

Page 28: Git preso to valtech cfml team

Benevolent Dictator

Page 29: Git preso to valtech cfml team

Some Commands

• Getting a Repository– git init– git clone

• Commits– git add

– git commit

• Getting information– git help– git status

– git diff

– git log– git show

Page 30: Git preso to valtech cfml team
Page 31: Git preso to valtech cfml team
Page 32: Git preso to valtech cfml team

Now with git goodness as well

Page 33: Git preso to valtech cfml team
Page 34: Git preso to valtech cfml team
Page 35: Git preso to valtech cfml team

1. Working on your own projects

2. Helping/ Contribute other OSS projects

Page 36: Git preso to valtech cfml team

Create new repository

Page 37: Git preso to valtech cfml team

After created,Everything you should know and do

Page 38: Git preso to valtech cfml team

Setting git before using github

• Generate SSH key in git ( Local )• $ssh-keygen -t rsa -C "[email protected]"

Page 39: Git preso to valtech cfml team

Copy data in file id_rsa.pub to github

Page 40: Git preso to valtech cfml team

Manage data with github

• $ git config --global user.name "up1"• $ git config --global user.email [email protected]• $ git init• $ touch README• $ git add README• $ git commit -m 'first commit'• $ git remote add origin [email protected]:up1/----

hello_tarad.git• $ git push -u origin master

Page 41: Git preso to valtech cfml team

Manage data with github ( demo )

Page 42: Git preso to valtech cfml team

Manage data with github (demo)

Page 43: Git preso to valtech cfml team

See result at github, Work !!

Page 44: Git preso to valtech cfml team

How to Contribute

1. Fork a repository at GitHub

2. Clone and connect your local repository

3. Write tests, implement functionality

4. Commit your local changes

5. Push your changes to your fork

6. Make a pull request

7. Profit!!

Page 45: Git preso to valtech cfml team

Very good series of blog posts by a CFML developer on Git workflow to contribute to other open source projects.

http://www.silverwareconsulting.com/index.cfm/Git-Workflow

Page 46: Git preso to valtech cfml team
Page 47: Git preso to valtech cfml team
Page 48: Git preso to valtech cfml team
Page 49: Git preso to valtech cfml team

progit.orghttp://git-scm.com