7 Useful Git Tips for Beginners

Sep 4 2013 by Tobias Günther | 14 Comments

Back when I first started to use Git for version control, I wasn’t sure if all the learning I invested into it would pay off. Branching, staging, stashing — these Git terms were all foreign to me.

Today, I can’t imagine life without Git. Git not only gave me a much-needed ability to version-control my work, it also made me a better programmer.

Here’s a series of simple tips that will help you make Git an important part of your web development workflow.

Tip 1: Spend Some Time Learning Git Basics

Learning the basics doesn’t mean you have to read the entire Git documentation from start to finish (although if that’s your thing, I wouldn’t discourage you from doing it).

There’s so much educational content on Git that I’m sure there’s something out there that fits your personal preferences and optimal learning style.

Learn Git Basics

Here are a few Git learning resources to check out:

Tip 2: Start with a Simple Git Workflow

Less is more.

Often, Git is associated with complex workflows. Let me say this though: You don’t have to completely master Git in order to instantly reap its benefits.

Git workflows can be extremely simple — and in a lot of cases "simple" is exactly all you need. Sure, you can use multiple remote repositories, issue pull requests, rebase your changes, etc. but you don’t have to if you don’t want to.

Starting with a simple workflow also makes it easier to add more complexity later on when you need Git’s more advanced features. The advanced features will be there for you when you need them.

Here are some examples of various Git workflows that you can take ideas and inspiration from:

The overarching point is this: Don’t stress out about needing to learn everything about Git. You can start using Git today.

Tip 3: Stop Being Afraid of Making Mistakes

A great thing about Git is that it’s almost 100% foolproof.

Keeping the following things in mind should let you sleep easy at night:

  1. Git hardly ever deletes data. Even actions that seem to delete items in reality actually add data to the system that will let you quickly undo deletions.
  2. You can undo almost everything in Git. I encourage you to experiment and explore Git and try out your ideas because this is one of the major benefits of using a version control system.
  3. Every member of your team has a repository cloned on his/her computer. Essentially, this is sort of like a redundant backup of the whole version-controlled project (including the full history) in the very unlikely event you do mess things up big time and can’t recover your mistake.

Tip 4: Understand the Concept of Branching

The concept of branching in Git is one of the most useful things you can learn at the start. Branching allows you to keep separate developments of one project possible and is a key component of being an effective Git user.

It may not sound like a big deal at first, but once you fully understand the concept of branching, you’ll wonder how you could have possibly lived without this ability.

Although other version control systems use the branching concept too, Git is the first system that really makes it easy and useful.

Git branching

Here are some resources to read that will help you understand the Git branching concept:

Tip 5: Learn About the Staging Area

Version control is most useful when you wrap up only related changes in a commit. This guarantees the commit can be rolled back easily without side-effects. The habit of making frequent commits also helps your coworkers more easily understand the progression of your changes.

Git makes granular commits easier than any other version control system (VCS) because you can determine which changes exactly shall be in the next commit.

A Git feature called staging area makes this possible.

Learn to use and love the staging area because it’s one of the most essential and unique components of Git.

Here are some resources about Git’s staging area:

Tip 6: Use a Git GUI

Although using a GUI is definitely not a requirement, I highly recommend it.

Using a GUI makes a lot of tasks easier and gives you a head start.

After all, using Git is not about learning commands and parameters by heart, it’s about using Git to improve your coding workflow. If a GUI enhances your coding workflow, there’s no reason to make things harder on yourself.

GitX (L) screenshot

Here are some Git GUIs to check out:

  • Tortoise Git – open source Git GUI for Windows
  • GitX (L) – open source Mac OS X Git client
  • SourceTree – free Git (and Mercurial) GUI for Mac and Windows
  • git-cola – an open source Git GUI
  • Tower – My company’s Git GUI for Mac users

Using a GUI will not relieve you from having to learn the basics, but once you’re happy with the level of Git mastery you have, investigate the tools that will make your life easier.

Tip 7: Commit Yourself to Using Git

Using a new tool can cause a bit of a headache in the first few days. The only way to get through this learning curve is to keep going.

Don’t look back; make a full commitment. Introducing Git into your normal coding workflow will soon prove to be one of the biggest and most significant things you’ve done in a while.

Avoid making exceptions like "I’ll use Git for these projects, but not for these other projects." At least at first.

The mindset of fully committing to Git gives you more opportunities to practice, makes things simpler because you know that the current project you’re working on is using a version control system, and most importantly makes Git a part of your coding habits.

In the future, you’ll see that there are just some situations where you don’t need to use Git. You won’t know what those situations are until you use Git in all the situations you can.

At the start of your journey towards Git mastery, make a 100% commitment to it.

Related Content

About the Author

Tobias Günther is CEO and founder of fournova. In 2010, he set out to make Git easier to use: Together with his team, he develops the Git desktop client, Tower for Mac.

14 Comments

David

September 4th, 2013

I was exactly the same way! Didn’t want to use Git but now basically any project I work on is based around it. Definitely worth the effort.

Abhay

September 6th, 2013

I’m happy to read this. Great article Tobias Günther

loop

September 6th, 2013

Best site for learning !! thanks a millions…

Night

September 6th, 2013

About git gui – for a long time I use Smart Git – this is win/mac/lin gui. P. S. I’m not paid to say so – it’s just great app. Regards

Juri

September 7th, 2013

Nice article. I found this interactive tutorial quite good for explaining Git branching to my work mates:http://pcottle.github.io/learnGitBranching/

Houdas

September 8th, 2013

This article is timed perfectly! I just started with Git recently and this article helped me understand many things. Thank you.

Nicolas Herbeault

September 9th, 2013

That’s quite interesting. I’ve never used Git but it seems very helpful. Thanks for sharing.

V-2

September 10th, 2013

I found Git Extensions to be the best GIT client for Windows. SourceTree for Windows doesn’t seem to be mature yet.

Brett

September 10th, 2013

Good article for those considering the use of Git. Thanks.

Sid

September 11th, 2013

Git flow (https://github.com/nvie/gitflow) makes it really easy to work with the branching model on Tip 4.

abbey

September 11th, 2013

I have not try it out… but i will find time to try it out…the way you explain git here is superb.. thanks for sharing

Daniel Lo Nigro

September 14th, 2013

If you’re on Windows, Git Extensions is a fantastic GUI for Git. :)

Evert Albers

September 18th, 2013

Don’t forget to mention GitHub for Mac and Windows. Perfect for beginnrs.

Sai Preet

September 26th, 2013

In beginning GitHub was an headache for me. Nice article, it should help the beginners.

Leave a Comment

Subscribe to the comments on this article.