28
Saturday, August 24, 13

WordPress and the Command Line

  • Upload
    dimmke

  • View
    83

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WordPress and the Command Line

Saturday, August 24, 13

Page 2: WordPress and the Command Line

daniel immke

Design Engineer at 10up

Worked with WordPress for 5 years

Started regularly using command line about 7 months ago

Saturday, August 24, 13

Page 3: WordPress and the Command Line

my story

Saturday, August 24, 13

Page 4: WordPress and the Command Line

my story

Developed themes for several years

Scared to adopt tools like version control because of perceived difficulty

Working at 10up and learning command line helped me break through that

Saturday, August 24, 13

Page 5: WordPress and the Command Line

what iscommand line?

Saturday, August 24, 13

Page 6: WordPress and the Command Line

Saturday, August 24, 13

Page 7: WordPress and the Command Line

Command line is not a scary tool that only hackers use.

Saturday, August 24, 13

Page 8: WordPress and the Command Line

Command line is simply a different wayof using your computer.

Saturday, August 24, 13

Page 9: WordPress and the Command Line

It’s the same!

Saturday, August 24, 13

Page 10: WordPress and the Command Line

Facts about command line

It was the original way to use a computer

Advanced users still prefer it because it is more powerful

Saturday, August 24, 13

Page 11: WordPress and the Command Line

command line basics

cd - Change directory

ls - List files in directory

nano - Opens file in simple text editor program

program specific commands

Saturday, August 24, 13

Page 12: WordPress and the Command Line

command line basics

mkdir - Create folder

cp - Copy a file

mv - Rename/move file

command -flag param1 param2

rm - Removes a file

Saturday, August 24, 13

Page 13: WordPress and the Command Line

command line basics

There are several other commands that one can learn to navigate the filesystem and edit files, that you can learn as you go.

Saturday, August 24, 13

Page 14: WordPress and the Command Line

password prompts

These happen in CLI too.

Saturday, August 24, 13

Page 15: WordPress and the Command Line

password prompts

sudo - If you don’t have sufficient permissions, put the sudo command before everything else and enter your password

sudo bash - Entering this by itself will allow you to enter a mode where you don’t have to enter your password. Use sparingly.

Saturday, August 24, 13

Page 16: WordPress and the Command Line

You won’t learn every command,but the basics are enough

to get started.

Saturday, August 24, 13

Page 17: WordPress and the Command Line

non windows systems

This talk is covering command line for Unix based systems only

The principles are the same

Even if you use Windows, knowing Unix is helpful with server administration.

Saturday, August 24, 13

Page 18: WordPress and the Command Line

what can I dowith command line?

Saturday, August 24, 13

Page 19: WordPress and the Command Line

improve theme development

If you learn command line, you can use many tools that will improve development

We are going to focus on arguably the most important: version control

Saturday, August 24, 13

Page 20: WordPress and the Command Line

Saturday, August 24, 13

Page 21: WordPress and the Command Line

version control: git

Git is a distributed version control system that a group of people can use to more effectively collaborate on projects.

Currently the preferred VCS over others like Subversion

Saturday, August 24, 13

Page 22: WordPress and the Command Line

installing git

http://git-scm.com

Configure global information at the command line like so:

git config --global user.name "John Doe"

git config --global user.email [email protected]

Saturday, August 24, 13

Page 23: WordPress and the Command Line

using git

Using the cd command to navigate to your theme directory

Type git init to create a git repo

Type git add * to add all files

Saturday, August 24, 13

Page 24: WordPress and the Command Line

committing with git

Then simply type git commit -m “initial commit” to begin versioning your theme with git

Writing concise commit messages will help you look through versions of your code.

Saturday, August 24, 13

Page 25: WordPress and the Command Line

other CLI tools

Grunt - Can be setup to automatically minify your css/js

vagrant - Virtual machine environment that replaces MAMP

wpcli - Tools for managing WordPress installations from CLI

Saturday, August 24, 13

Page 26: WordPress and the Command Line

Demo time!

Saturday, August 24, 13

Page 27: WordPress and the Command Line

what you (hopefully) learned

Command line isn't scary, the basics are actually pretty easy

Overview of basic version control in Git using the command line

With command line, you can use many tools that will improve themes.

Saturday, August 24, 13

Page 28: WordPress and the Command Line

Thanks for listening!

@daniel_immke on Twitter

These slides are available at http://slideshare.net/dimmke

Saturday, August 24, 13