Do: Set up a Github account and push some code

This is the sixth article in our “The 12 Dos and Don’ts of becoming a Web Developer” series.

“Fine,” you tell me.  “I won’t get caught in tutorial paralysis.  So what do I need to do?”

Set up a Github account and push some code, young padawan.  It’s that simple.

It doesn’t matter what you’re working on; create a repository for it, commit it, and push it to Github.  It doesn’t matter if it’s good or not; you can always go back and improve it later, or leave it as-is and push something better to a new repository next time. Once you figure it out, it will take you an extra 30 seconds every hour or so to do this, but the benefits are pretty great:

1) Remember when I said you need a solid grasp of Git?  Here’s your chance to practice.  Initializing a repository, adding your changes, committing them with a descriptive message, and pushing them to a remote repository (such as Github) should all be second nature to you.  That way, when you start working on a team and need to handle more advanced concepts like branching / merging  / rebasing, soft and hard resets, cherry-picking, etc., you won’t feel totally overwhelmed — or, worse, break something and have to spend an hour figuring out how to undo it.

You’ll be able to turn a moment like this:

tyraface

Into a moment like this:

me-working

2) Employers love to see that you’ve been active on Github.  From my experiences with hiring and conversations with other developers, I’d say that having an active Github profile will not only move you to the top of the pile but probably put you in the top 10-20% of applicants.  It shows that you not only know what the hell you’re doing but also gives us a window into how you solve problems.  Github alone may not get you a job, but if you have an active profile, it’ll definitely get you some interviews.  That’s where you get to kick ass, take names (literally.  Get business cards.  You’ll never know when you’ll need them), and show what an awesome member of the team you’ll be.

like_a_boss

3) You never know when you’re going to need old code.  Perhaps you’re trying to remember how you made a full-size background image resize properly on a website you built six months ago, but you can’t recall exactly how you pulled it off and you need to do it again for a new site you’re working on.  You can either a) spend an hour or two Googling how to do it and trying to re-implement it or b) take a peek at your Github profile, grab the code, and adjust it for the new project.  Having tried-and-true code snippets at hand will save you a lot of time.

tumblr_mw2s58tgxt1qdlh1io1_400

One final protip before you go: commit early, commit often, and leave yourself descriptive messages about what you actually did (no “updated css and lots of other changes” crap).  When you break something (and you will) and need to revert to an earlier commit, you’ll be glad you did this.  What I like to do is, before I sit down and write a single line of code, think of my commit message in terms of my tasks ahead of time; if my commit message involves the word “and” too many times (“updated styling of h1 on front page AND repositioned contact box AND performed data-sanitization on contact box”), I know I need to be vigilant about breaking it up into multiple commits.  You’ll make your life a lot easier, trust me.

Most of the resources I linked in my earlier post cover Git in some shape or form, but here are a few additional (free) resources to check out:

http://try.github.io/levels/1/challenges/1
http://git-scm.com/book
http://gitimmersion.com/

One more thing before I sign-off (I’ve said it before, but it bears repeating): invest the time to learn Git in the command line.  There are programs out there (such as Sourcetree) that will handle a lot of the heavy lifting for you, but they also make it much, much easier to screw things up (as one unfortunate developer in my acquaintance learned recently, when he accidentally deleted most of his hard drive.)  The command line is a powerful tool, and even though it’s super intimidating at first, it won’t take you long to become familiar with it — as long as you take the time to learn it.

Articles in this series:

Filed in: Web Development