wordcamp kc 2014: version control using git

Post on 29-Nov-2014

274 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Version control is a must for any professional web developer, frontend or backend. There are many ways to setup Git, but in my talk, the aim was to cover the simplest approach possible so folks could get set up quickly. To view the complete tutorial, visit: http://frankiejarrett.com/wordcamp-kc-version-control-using-git/

TRANSCRIPT

Hi, my name isFrankie Jarrett

from St. Joseph, MO

I’m a WordPress developer & entrepreneur.

Version Control Using GitFrankie Jarrett

@fjarrett

VERSION CONTROL

USING GIT

Version Control Using GitFrankie Jarrett

@fjarrett

1. Tools you need (free)2. Basic CLI commands3. Basic Git commands4. Setup and use a repo

Version Control Using GitFrankie Jarrett

@fjarrett

Frankie, I want to useversion control but…

it’s too complicated.

Version Control Using GitFrankie Jarrett

@fjarrett

Frankie, I want to useversion control but…

I’m set in my ways.

Version Control Using GitFrankie Jarrett

@fjarrett

Frankie, I want to useversion control but…

I don’t know where to start.

Version Control Using GitFrankie Jarrett

@fjarrett

YOUR LIFECAN BE CHANGED

TODAYVersion Control Using Git

Frankie Jarrett@fjarrett

Why use command line?But I don’t do server ops!

GUI == Graphic User InterfaceCLI == Command Line Interface

GUI’s are limiting. The command line is freedom, control and speed.

After a while you will find yourself feeling slowed down by your mouse and craving the terminal.

Is there a GUI option for using Git?

As far as you’re concerned, no there isn’t.

Version Control Using GitFrankie Jarrett

@fjarrett

POSIXPOSIX == Portable Operating System Interface

● Unix

● Linux

● Solaris

● BSD

● Darwin (Mac OS X)

POSIX basically means that these operating systems use the same utility interface.

So the CLI commands look the same, and work the same, across all of these systems.

Version Control Using GitFrankie Jarrett

@fjarrett

Windows is not a POSIX-compatible operating system, so it’s command line tools aren’t quite the same.

If we were .NET developers, then we would have to use Windows.

But we are WordPress developers, so it’s likely that our web servers are running some form of Linux.

The point of local development is to mimic live environments as much as possible.

Still using Windows?Windows != POSIX

Version Control Using GitFrankie Jarrett

@fjarrett

Our ToolboxEverything is free and comes in easy-to-install packages

Version Control Using GitFrankie Jarrett

@fjarrett

● Xcode 5.1.1

○ Git

● iTerm2

We’ll be running these on OS X Mavericks (10.9.3)

● Change directories: cd wp-content/themes

● Shortcut to your home directory: cd ~

● Go up one directory: cd ..

● List: ls or ls -la

● Create a file: touch filename.txt

● Edit a file: nano filename.txt

● Clean up our terminal view: clear

Protip: Tab-completion is your best friend!

Easy POSIX CommandsA few CLI tips to hit the ground running

Version Control Using GitFrankie Jarrett

@fjarrett

1. Add our Name and Email to the Git config on our computer

2. Create an SSH Public Key on our computer

3. Add our Public Key to our account profile on GitHub.com

4. Clone a repo onto our computer using SSH

5. Commit and push changes back to GitHub.com

Protip: Git != GitHub.com

Link to GitHub over SSHSSH == Secure Shell

Version Control Using GitFrankie Jarrett

@fjarrett

● See your changed files: git status

● Queue up files: git add -A

● Make a commit: git commit -m ‘Fixed a broken footer link’

● Push our commits to GitHub.com: git push

● Pull down the latest from GitHub.com: git pull

● Switch branches: git checkout branchname

Protip: Go bookmark GitRef.org as a handy reference!

Easy Git CommandsA few Git CLI tips to hit the ground running

Version Control Using GitFrankie Jarrett

@fjarrett

LET’S

GIT STARTED;-)

Version Control Using GitFrankie Jarrett

@fjarrett

THANKS FOR

LISTENING

Version Control Using GitFrankie Jarrett

@fjarrett

frankiejarrett.comFollow me @fjarrett

top related