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.