Hey, remember the last time you lost work on your project? 😭
We’ve all made that mistake at least once before adopting a source control management system (does this sound like an ad?).
In my last post, I walked through the installation of a package manager for Windows called Chocolatey, and we will continue to use it in this post to install Git. So, install Chocolatey if you’d like, and let’s get started!
Chocolatey makes it incredibly easy and straightforward to install Git.
Open an Administrative Shell and run:
choco install git -y
Unless you encountered connectivity or local machine issues, you now have Git installed! Restart your shell and verify the installation was successful using:
At some point, there will be a new version of Git you’ll want to download, which can come as a new Chocolatey package update, or you can update via a Git command.
Let’s cover both options next.
Update Git via Chocolatey
Here’s something you should know about Chocolatey (and most other packages managers). If you want to see the commands available to you, use the help command.
Scroll up until you see the list of commands, and you’ll see one named
outdated, which lists packages that are out of date on your machine. If you run this and see that Git is out of date, you can use the following command to update the Git package:
choco upgrade git
Update Git via Git Command
Another way to upgrade Git is using the
update-git-for-windows command in an Administrative Shell:
Now that we have Git installed, we can source control our Unity projects to keep a history of changes, collaborate with others, and save ourselves from losing work!
We’ll talk more about using Git with Unity Projects in an upcoming post. Take care.