+ All Categories
Home > Documents > Version Control ThinkVitamin

Version Control ThinkVitamin

Date post: 01-Dec-2014
Category:
Upload: alex-hillman
View: 1,137 times
Download: 0 times
Share this document with a friend
Description:
Chris Nagele and Alex Hillman of Wildbit (makers of http://beanstalkapp.com) give an intro to source control and Git for designers and VCS newbies.
84
Version Control Chris Nagele Alex Hillman
Transcript
Page 1: Version Control ThinkVitamin

Version Control

Chris NageleAlex Hillman

Page 2: Version Control ThinkVitamin

Today's Agenda

1. A bit about us2. A bit about version control3. A practical intro to Git

Page 3: Version Control ThinkVitamin

We're from Wildbit

Chris NageleFounder 

• Transitioned business from consulting to product

• International Team - 7 countries represented

• Writer - ThinkVitamin, etc

• Spends days in the server closet 

Alex HillmanBusiness Development

• Web development background

• Cofounded Indy Hall - Coworking in Philadelphia

• Public Speaker - SXSW, etc

• Spends days communicating with our customers

Page 4: Version Control ThinkVitamin

Beanstalkapp.com

Go sign up for a free trial now!

Page 5: Version Control ThinkVitamin

Why Version Control?

 

Page 6: Version Control ThinkVitamin

Why Version Control?

cp index.html index-v12-old2.html

Page 7: Version Control ThinkVitamin

Why Version Control?

cp index.html index-v12-old2.html

There has to be a better way

Page 8: Version Control ThinkVitamin

The Old Way

• Unmaintainable filesystems and filenames

• Accidental overwriting of revisions

• Updates on live server

• Communicate with team via e-mail

• Multiple server management nightmare 

 

Page 9: Version Control ThinkVitamin

The New Way

• Filenames stay the same!

• Make changes with confidence - even revert!

• Source control as "source" for updates

• Code as communication with the whole team

• Deploy different versions to different servers easily

 

Page 10: Version Control ThinkVitamin

Vocabulary Lesson• Repository

• Track Changes

• Add or Update Files

• Commit Changes

• Revision

• Revert

• Branch

• Merge

• Diff 

Page 11: Version Control ThinkVitamin

Version Control Options

 

Page 12: Version Control ThinkVitamin

Centralized

 

Page 13: Version Control ThinkVitamin

Centralized

Client & Server Relationship

Page 14: Version Control ThinkVitamin

CentralizedSubversion - 

Benefits

• Easy to understand

• More control over users and access

• More GUI & IDE clients

• Simple to get started

• Free & Open Source!

Disadvantages

• Dependent on a server

• Hard to manage a server (and backups!)

• Slower

• Some advanced tasks are very difficult

Page 15: Version Control ThinkVitamin

Decentralized

(also known as Distributed) 

Page 16: Version Control ThinkVitamin

Decentralized

A Network of Complete "Repositories"

Page 17: Version Control ThinkVitamin

DecentralizedGit & Mercurial 

Benefits

• Powerful and detailed change tracking (you commit more often)

• No server necessary - everything is local

• It's fast to branch and merge 

• Free & Open Source!

Disadvantages

• More to learn in order to  get started

• Not as many GUI or IDE clients

• It doesn't protect you from yourself

Page 18: Version Control ThinkVitamin

Any questions so far?

 

Page 19: Version Control ThinkVitamin

Get Git!

 

Page 20: Version Control ThinkVitamin

Get Git!

http://bit.ly/downloadgit - for OSX

Page 21: Version Control ThinkVitamin

Get Git!

http://bit.ly/downloadgit - for OSX

Other platform? Sorry!

http://git-scm.com

Page 22: Version Control ThinkVitamin

Get Sample Files

http://bit.ly/samplefiles

Page 23: Version Control ThinkVitamin

Terminal

 

Page 24: Version Control ThinkVitamin

Global Config

 

Page 25: Version Control ThinkVitamin

Global Config

git config --global user.name "Alex Hillman"git config --global user.email "[email protected]"  

Page 26: Version Control ThinkVitamin

Global Config

git config --global user.name "Alex Hillman"git config --global user.email "[email protected]"  

Verify:

git config --list

Page 27: Version Control ThinkVitamin

Global Config - Bonus!

git config --global color.status autogit config --global color.branch auto    

Page 28: Version Control ThinkVitamin

Global Config - Textmate Bonus!

git config --global core.editor "mate -w"   

Or replace "mate -w" with your favorite text editor

Page 29: Version Control ThinkVitamin

Command Line Basics

   pwd - present working directory

   cd - change directory

   cd .. - change directory up one folder level

   ls - list everything in present working directory

   mkdir - make directory

   cp - copy

   mv - move

Page 30: Version Control ThinkVitamin

My First Repository

You never forget your first

Page 31: Version Control ThinkVitamin

Ignoring Files

It's nothing personal

Page 32: Version Control ThinkVitamin

Git Status

What the hell is going on?

Page 33: Version Control ThinkVitamin

The Stage

And how to get your files on it

Page 34: Version Control ThinkVitamin

PSA: Beware of Empty Folders!

 

Page 35: Version Control ThinkVitamin

Committing

No diamond necessary

Page 36: Version Control ThinkVitamin

Committing ChangesA little about "insertions" and "deletions"

• Git is about "content"

• An insertion adds a new line of content

• A deletion removes a line of content

• A change is actually a deletion + an insertion

 

Page 37: Version Control ThinkVitamin

Committing ChangesA little about "insertions" and "deletions"

• Git is about "content"

• An insertion adds a new line of content

• A deletion removes a line of content

• A change is actually a deletion + an insertion

• Every change is very small, so commit often

• More commits = more communication

Page 38: Version Control ThinkVitamin

Inline Commits

For quickies

Page 39: Version Control ThinkVitamin

Verbose Commits

More to say? That's ok!

Page 40: Version Control ThinkVitamin

Stash

Git's "Clipboard"

Page 41: Version Control ThinkVitamin

Commits as Communication

Tasks, tickets, links, & more

Page 42: Version Control ThinkVitamin

Log

What happened and when?

Page 43: Version Control ThinkVitamin

Remotes

Don't change that channel

Page 44: Version Control ThinkVitamin

Sign up for Beanstalk!

It’s ok…we’ll wait….

Page 45: Version Control ThinkVitamin

Keys

Page 46: Version Control ThinkVitamin

Keys

ssh-keygen -t rsa

Page 47: Version Control ThinkVitamin

Keys

ssh-keygen -t rsa

cat ~/.ssh/id_rsa.pub | pbcopy

Page 48: Version Control ThinkVitamin

Keys

Page 49: Version Control ThinkVitamin

Creating a Remote

The Easy Way – with Beanstalk

Page 50: Version Control ThinkVitamin

git remote add

Page 51: Version Control ThinkVitamin

git push

Page 52: Version Control ThinkVitamin

git push beanstalk master

Page 53: Version Control ThinkVitamin

Remotes

Connecting some dots between the command line and Beanstalk

Page 54: Version Control ThinkVitamin

Remotes

I Think I’m A Clone Now

Page 55: Version Control ThinkVitamin

Catastophe

Delete your work

Page 56: Version Control ThinkVitamin

git clone

Page 57: Version Control ThinkVitamin

git remote

Page 58: Version Control ThinkVitamin

git remote rename

Page 59: Version Control ThinkVitamin

git pull

Page 60: Version Control ThinkVitamin

git pull beanstalk master

Page 61: Version Control ThinkVitamin

Branches

Page 62: Version Control ThinkVitamin

git branch

Page 63: Version Control ThinkVitamin

git checkout

Page 64: Version Control ThinkVitamin

Branches + Remotes

Page 65: Version Control ThinkVitamin

git push beanstalk ________

where ________ is the name of your branch

Page 66: Version Control ThinkVitamin

git push beanstalk colorchange

Page 67: Version Control ThinkVitamin

git pull beanstalk colorchange

Page 68: Version Control ThinkVitamin

Integrating Changes

Without A Time Traveling DeLorean.

Page 69: Version Control ThinkVitamin

Rebase

Page 70: Version Control ThinkVitamin

Rebase

Check out progit.org

Page 71: Version Control ThinkVitamin

Merge

Page 72: Version Control ThinkVitamin

Make sure you’re on the branch you want to merge TO

Page 73: Version Control ThinkVitamin

git merge __________

Where __________ is the name of your branch you wish to merge in.

Page 74: Version Control ThinkVitamin

Keep that Repo Tidy

Page 75: Version Control ThinkVitamin

git branch –d __________

Where __________ is the name of your branch you wish to delete.

Page 76: Version Control ThinkVitamin

Conflict Resolution

Page 77: Version Control ThinkVitamin

You didn’t commit yet!

Page 78: Version Control ThinkVitamin

You didn’t commit yet!

error: Your local changes to the following files would be overwritten by merge:

index.phpPlease, commit your changes or stash them before you can merge.Aborting

Page 79: Version Control ThinkVitamin

You Did Commit! But…

Page 80: Version Control ThinkVitamin

You Did Commit! But…

* branch master -> FETCH_HEADAuto-merging index.phpCONFLICT (content): Merge conflict in index.phpAutomatic merge failed; fix conflicts and then commit the result.

Page 81: Version Control ThinkVitamin

Conflict Delimiters

Page 82: Version Control ThinkVitamin

Commit, then push!

Page 83: Version Control ThinkVitamin

Where to learn more

Page 84: Version Control ThinkVitamin

Thank You!

Chris Nagele – Alex Hillmanhttp://www.beanstalkapp.com

@beanstalkapp


Recommended