Getting Started with 🍦.11ty.js, Part III: An Introduction to Git

This is the third post in a five-part series on “Getting Started with 🍦.11ty.js”

What is Git?

Short answer: Git gives you super powers 🏋️.

Slightly longer answer: Git allows you to store a personal copy of a piece of software on your computer, which you can also connect with a “master” copy on the Internet.

In tech speak, Git is a type of program known as a distributed version-control system, which means people around the world can work together to develop the same application 🤓.

In plain language, Git makes it possible for you to get updates (and make your own!) for a software program, namely, 🍦.11ty.js and the website you build with it 🏗️.

🎣 How Do You Get Git?

Technically, you don’t need to install Git on your computer. If you really wanted to, you could work entirely online with GitLab. But, as I alluded to in the first post of this series, you can do a lot more testing and fine tuning from your local development environment.

Do You Also Need a GitLab Account? 🤔

Short answer: No, but it won’t hurt.

Slightly longer answer: You can do a lot more by having an account with an online Git hosting service like GitLab or GitHub. Having a GitLab account, in particular, allows you to submit issues and feature requests to improve 🍦.11ty.js.

There are multiple ways to install Git on your operating system. Here are what I know to be the clearest, officially supported methods. If you’re interested, the Git website lists a few more options.

On 🐧 Ubuntu Linux

Open your terminal and enter the following commands.

1. Check if your computer already has Git:
git --version

If you don’t have Git installed already, then the command line will prompt you to install it.

Even if you already have Git installed, it’s still a good idea to update your system so you can access to the latest supported version of Git.

2. Update your system:

I recommend running this pair of commands:

sudo apt update
sudo apt -y dist-upgrade

If you already have Git installed, you can skip to configuring Git.

3. Install Git:
sudo apt install git

All that’s left is to configure Git.

On 🍏 macOS

Open your terminal and enter the following command:

git --version

If you don’t already have Git installed on your system, the command line will prompt you to install Xcode, Apple’s official suite of developer tools which includes Git.

All that’s left is to configure Git.

On 🏢 Windows

1. Download the latest version from the Git website.
2. Open the downloaded program and follow the instructions from the installation wizard.

All that’s left is to configure Git.

🔧 Configuring Git

Once you have Git installed on your workstation, you’ll need to set your username and e-mail.

In your terminal, enter the following commands, replacing the example text with your information:

git config --global user.name "Your Name"
git config --global user.email "example@email.com"

📥 Downloading Your Local Copy of 🍦.11ty.js with Git

Now that you have Git installed and configured, you can download a copy of 🍦.11ty.js from GitLab.

In your terminal, enter the following command, replacing my-blog-directory-name with the file path where you want to store your copy of 🍦.11ty.js on your computer (or omit the file path from the end of the command, and Git will create a directory named eleventy-dot-js-blog in the current directory):

git clone git://github.com/reubenlillie/eleventy-dot-js-blog.git my-blog-directory-name

We’ve barely scratched the surface with Git. But now that you have Git and a local copy of 🍦.11ty.js, we can pick up in the next post of this series with installing Node.js and Eleventy.