-
-
Save JulianRamirez/a76e41c2691ee00f3851 to your computer and use it in GitHub Desktop.
In light of git having a security vulnerability it is time to update git. This gist will do just that if you're running on a mac and prefer to use the default git installation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
curl -o git-2.2.1.tar.gz "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz" | |
curl -o git-2.2.1.tar.sign "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.sign" | |
# if you want to verify the tar signature | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 6092693E | |
gunzip git-2.2.1.tar.gz | |
gpg --verify git-2.2.1.tar.sign | |
# look for "Good signature" | |
# you may get "WARNING: This key is not certified with a trusted signature!" - this is ok | |
tar xfv git-2.2.1.tar | |
# if you skipped gpg verification | |
tar zxvf git-2.2.1.tar.gz | |
cd git-2.2.1 | |
./configure | |
make | |
sudo make install | |
# this should install git at /usr/local/bin/git | |
# if your `which git` is different, you might have to re-soft-link this path to the new installation | |
# in my case, i had to re-soft-link /usr/bin/git | |
sudo mv /usr/bin/git /usr/bin/git-old | |
sudo ln -s /usr/local/bin/git /usr/bin/git | |
git --version | |
# > git version 2.2.1 |
Thanks! Worked like a charm 🤘
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is identical to @jazzychad's original except it moves the old git binary to git-old instead of flat out deleting it.
After running the script be sure to run
git --version
to verify that version 2.2.1 was installed.