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.