Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Learn what Git is and how it can save you from losing your work!
According to the Stack Overflow 2017 Developer survey, Git is now the world's most popular version control system, with close to 70% of developers using it.
Installing and using Git on your computer
- Windows: Git is not pre-installed on Windows machines. Check out our video on Git installation for Windows. Be sure to check the Teacher's Notes on the video page for additional notes, as the installation process has changed slightly since the video was recorded.
- Mac: Every Mac comes with Git pre-installed! To access it, all you need to do is open a terminal with a Bash prompt. You can find instructions for opening the Terminal program in this Treehouse Blog post.
- Linux: Linux systems also come with Git pre-installed. If you're running Linux, we assume you already know how to get to a terminal, but if you're stuck, click the Get Help button on this page to ask for help in the Treehouse Community forum.
Resources
- You can learn more about working in the console/terminal with our Console Foundations course.
- On many systems, Git is configured to use the
vi
text editor by default. You may want to familiarize yourself with basicvi
commands.
-
0:00
[MUSIC]
-
0:06
Hi, I'm Jay McGavren, a web developer and teacher at Treehouse,
-
0:11
and I'm here to introduce you to the Git version control system.
-
0:17
Now we know, you're probably itching to get back to coding.
-
0:20
You're probably wondering what a version control system is nd
-
0:23
why you'd even need one.
-
0:25
Or if you know what version control systems are, you may be wondering,
-
0:29
why should I choose Git?
-
0:31
If you haven't been a developer very long,
-
0:33
then you may not have lost any of your work.
-
0:35
You haven't accidentally deleted files you need or
-
0:38
introduced a bug you can't find the cause of, yet.
-
0:41
Let me assure you, it's a matter of time before you do.
-
0:45
Version control systems keep old versions of your files for you.
-
0:48
Like a time traveler, you can jump back to earlier versions.
-
0:52
This is really helpful when you make mistakes or delete files, and
-
0:55
want to recover your work.
-
0:57
Think of it like an undo command for an entire project's worth of files.
-
1:02
Version control is so important that many different
-
1:05
version control systems have been created over the years.
-
1:08
Examples include subversion and more recently, Mercurial and Git.
-
1:13
According to the Stack Overflow 2017 developer survey,
-
1:16
Git is now the world's most popular version control system.
-
1:20
With close to 70% of developers using it, when you join a development team,
-
1:25
there's a very good chance they're going to want you to use Git.
-
1:29
Now, we don't wanna mislead you, learning Git will take some work.
-
1:33
For those of you that haven't used the terminal before,
-
1:35
we'll need to give you a brief primer in how to run commands.
-
1:39
And even if you know your way around the Terminal, but
-
1:41
less frequently use Git commands can be challenging to understand.
-
1:45
But once you know what's going on and have had some practice, Git is easy to use.
-
1:50
The most commonly used commands aren't very complicated.
-
1:53
More importantly, Git is a powerful way to share work across a team.
-
1:58
And because it's distributed, you won't lose all your project's history if
-
2:01
something happens to the central server, as we'll see in the next video.
-
2:05
I've used Git every working day for almost ten years now, and
-
2:09
personally I would never switch back to another version control system.
-
2:13
Git is just that much better.
-
2:16
So Git may take some work to learn, but
-
2:17
let me assure you, the payoff is totally worth it.
-
2:21
And don't worry, we're going to walk you through every step of the way.
-
2:24
We're not going to cover every aspect of Git, but
-
2:27
we are going to cover the most commonly used aspects in careful detail.
-
2:31
We'll show you what the commands mean, how to work with command line options, and
-
2:35
everything else you need to know.
-
2:38
Have your ever heard the phrase, use it or lose it in reference to your memory?
-
2:42
We're bombarded by irrelevant information like advertisements and gossip everyday.
-
2:47
And your brain has evolved to forget most of it.
-
2:51
And your brain could decide to forget the information in this course
-
2:54
unless you convince it this stuff matters.
-
2:57
You tell your brain not to forget a piece of information by using that information.
-
3:02
When you make your brain work to recall something,
-
3:05
your brain decides it's important and keeps it around longer.
-
3:08
That's why we're providing you with quizzes, code challenges, and
-
3:12
other opportunities for practice as part of this course.
-
3:15
Make sure you practice what you've learned,
-
3:18
you'll remember it much better if you do.
-
3:21
Our focus will be to get you up and running with Git.
-
3:24
And then get your code shared on GitHub or
-
3:26
another code hosting site of your choosing.
-
3:29
There's more to get than that, but we'll be showing you the commands that
-
3:32
even professional developers spend 80% of their time using.
-
3:36
We'll have links in the teachers notes to resources where you can learn the other
-
3:39
stuff if you want.
-
3:40
Don't hesitate to use the video play back controls during the course.
-
3:44
For the parts you already know, you can put the video on double speed.
-
3:48
For the parts you need to review more closely you can put the video on half
-
3:51
speed, rewind it, or pause it as needed.
-
3:55
It's important to follow along as we go through the course, but
-
3:57
you don't have to have Git installed on your computer.
-
4:00
We have Git pre-installed for you on workspaces,
-
4:03
Treehouse's online development environment.
-
4:05
In addition to a code editor,
-
4:07
workspace includes a console that works just like a Terminal on your computer.
-
4:11
And we've made sure Git is available from that console.
-
4:14
If you prefer to work on your local computer,
-
4:16
you'll probably need to install Git first.
-
4:19
We'll have help on that in the teacher's notes.
-
4:22
All the commands we show you in work spaces,
-
4:24
should work the same way in your terminal.
-
4:26
Now you know what Git can do for you, up next,
-
4:28
we'll give you an overview of how Git works.
You need to sign up for Treehouse in order to download course files.
Sign up